NIHVIVO-160 FileStorage.getInputStream returns an InputStream, instead of an array of bytes. Read it however you like.

This commit is contained in:
jeb228 2010-05-24 19:27:27 +00:00
parent b86ec9e7b2
commit f40e2d1af7
3 changed files with 19 additions and 35 deletions

View file

@ -6,6 +6,7 @@ import static edu.cornell.mannlib.vitro.webapp.utils.filestorage.FileStorageFact
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@ -148,10 +149,11 @@ public class FileStorageFactoryTest extends AbstractTestClass {
return "filename";
}
public byte[] getFile(String id, String filename)
public InputStream getInputStream(String id, String filename)
throws FileNotFoundException, IOException {
return new byte[0];
return new ByteArrayInputStream(new byte[0]);
}
}
/** This class has no zero-argument constructor. */
@ -172,10 +174,11 @@ public class FileStorageFactoryTest extends AbstractTestClass {
return "filename";
}
public byte[] getFile(String id, String filename)
public InputStream getInputStream(String id, String filename)
throws FileNotFoundException, IOException {
return new byte[0];
return new ByteArrayInputStream(new byte[0]);
}
}
/** This class does not implement the FileStorage interface. */