- /**
- * Retrieves the data as Byte Array given an uri.
- *
- * <p>
- * Overwrite to provide application specific abilities, among other to open
- * from a JCR repository
- * </p>
- */
- protected byte[] getFileAsByteArray(String uri) {
- if (uri.startsWith(FILE_SCHEME)) {
- try {
- return FileUtils.readFileToByteArray(new File(
- getFilePathFromUri(uri)));
- } catch (IOException ioe) {
- throw new SingleSourcingException("Error getting the file at "
- + uri, ioe);
- }
- }
- return null;
+ // FIXME we always use temporary files for the time being.
+ // the deleteOnClose file only works when the JVM is closed so we
+ // explicitly delete to avoid overloading the server
+ if (path.startsWith("/tmp"))
+ path.toFile().delete();