Revision: 4613 http://sourceforge.net/p/vexi/code/4613 Author: mkpg2 Date: 2013-12-18 15:35:17 +0000 (Wed, 18 Dec 2013) Log Message: ----------- Additional logging/checks.
Modified Paths: -------------- trunk/org.vexi-library.crypto/src/main/java/org/vexi/DotVexi.java Modified: trunk/org.vexi-library.crypto/src/main/java/org/vexi/DotVexi.java =================================================================== --- trunk/org.vexi-library.crypto/src/main/java/org/vexi/DotVexi.java 2013-12-17 00:30:38 UTC (rev 4612) +++ trunk/org.vexi-library.crypto/src/main/java/org/vexi/DotVexi.java 2013-12-18 15:35:17 UTC (rev 4613) @@ -43,11 +43,16 @@ } public File getBaseDir(){ return _; } + + private void createDirOrError(File dir){ + if(!_.exists() && !_.mkdirs()) throw new Error("Could not create directory: " + _); + + } + public void init(){ - if(!_.exists() && !_.mkdirs()) throw new Error("Could not create .vexi directory: " + _); - _cache.mkdir(); - _install.mkdir(); - // certificates + createDirOrError(_); + createDirOrError(_cache); + createDirOrError(_install); } public File findSubDir(String dir) { @@ -123,7 +128,7 @@ boolean versioned = isVersioned(fileType); File tempfile = new File(localfile.getParent(),localfile.getName()+".temp"); - log("Using: " + getDisplayName(fileType, url, filename)); + log("Using "+(versioned?"versioned":"unversioned")+" file: " + getDisplayName(fileType, url, filename)); if(versioned){ @@ -131,6 +136,7 @@ log("... local copy available " + localfile.getAbsolutePath()); }else{ InputStream is = getInputStream(fountain,principal); + log("... download and verify (versioned)"); VerifySigned.verify(organisationToPK, is, filename, new FileOutputStream(tempfile)); replace(localfile, tempfile); @@ -146,8 +152,10 @@ log("... cached copy available " + localfile.getAbsolutePath()); }else{ if(signed){ + log("... download and verify (unversioned)"); VerifySigned.verify(organisationToPK, is, filename, new FileOutputStream(tempfile)); }else{ + log("... download"); pipe(is, tempfile); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn