I have been trying to write and read files directly from the BlobStore, but it just doesnt work.
The issue is I open the file like file = fileService.getBlobFile(blobKey); and it doesn’t throw any exception but right in the next line I call readChannel = fileService.openReadChannel(file, false); and that one throws a FileNotFoundException.
I’m confused as to why the first line did not throw the exception.
Unfortunately no one answered that question.
I haven’t had any problems with writes or deletes, but I too get a
FileNotFoundExceptionwhen usingopenReadChannel(...)with anAppEngineFile.I’ve tried using an
AppEngineFilecreated from its constructor taking a complete path. I’ve tried using anAppEngineFileobtained fromgetBlobFile(...)like you do above. Either way, when theAppEngineFileis passed toopenReadChannel(...)aFileNotFoundExceptionis thrown.My workaround was to let
BlobstoreService.serve(...)do all the work of reading and sending the file. I suspect that using theFileServiceto read from anAppEngineFileisn’t supported yet (I’m using 1.6.0), so reads must be done via theBlobstoreService(serve(...),fetchData(...),BlobstoreInputStream).