ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1368930 - /ace/sandbox/marrs/org.apache.ace.obr.storage/src/org/apache/ace/obr/storage/file/BundleFileStore.java
Date Fri, 03 Aug 2012 13:12:24 GMT
Author: jawi
Date: Fri Aug  3 13:12:24 2012
New Revision: 1368930

URL: http://svn.apache.org/viewvc?rev=1368930&view=rev
Log:
Method should return null for non-existing files as defined in its contract.

Modified:
    ace/sandbox/marrs/org.apache.ace.obr.storage/src/org/apache/ace/obr/storage/file/BundleFileStore.java

Modified: ace/sandbox/marrs/org.apache.ace.obr.storage/src/org/apache/ace/obr/storage/file/BundleFileStore.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.obr.storage/src/org/apache/ace/obr/storage/file/BundleFileStore.java?rev=1368930&r1=1368929&r2=1368930&view=diff
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.obr.storage/src/org/apache/ace/obr/storage/file/BundleFileStore.java
(original)
+++ ace/sandbox/marrs/org.apache.ace.obr.storage/src/org/apache/ace/obr/storage/file/BundleFileStore.java
Fri Aug  3 13:12:24 2012
@@ -21,6 +21,7 @@ package org.apache.ace.obr.storage.file;
 import java.io.Closeable;
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -69,7 +70,13 @@ public class BundleFileStore implements 
         if (REPOSITORY_XML.equals(fileName) && directoryChanged(getWorkingDir()))
{
             generateMetadata(); // might be called too often
         }
-        return new FileInputStream(createFile(fileName));
+        FileInputStream result = null;
+        try {
+			result = new FileInputStream(createFile(fileName));
+		} catch (FileNotFoundException e) {
+			// Resource does not exist; notify caller by returning null...
+		}
+		return result;
     }
 
     public boolean put(String fileName, InputStream data) throws IOException {



Mime
View raw message