commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JavaDev7 <user100...@post.sk>
Subject Files in "..temp\vfs_cache" are not deleted after read zip
Date Tue, 26 Apr 2011 11:40:39 GMT
Hi everybody,

I don'tknow how to ensure that files after processing will be
deleted from "Temp\vfs_cache" ..

I have multithreaded aplication.
Each thread read remote zip archives ...

My code looks like this:

StandardFileSystemManager fsm = new StandardFileSystemManager();
fsm.setCacheStrategy(CacheStrategy.ON_CALL);	
fsm.init();

// do some job.. read zip and get content to byte[]
/*
FileName fName = fsm.resolveURI(...)
FileObject dir = fsm.resolveFile("zip:" + fName.toString());
FileObject[] fObjs = dir.getChildren(); // get files in zip
process fObjs ...
*/

If I call fsm.close() -> files are not clear from \Temp\vfs_cache

I also tried almost everything:

FileSystem fs = dir.getFileSystem();
fsm.closeFileSystem(fs);
fsm.getFilesCache().removeFile(fs, fName);

PrivilegedFileReplicator fr = (PrivilegedFileReplicator)fsm.getReplicator();
fr.close();

Not is working.. :(

I need read zip file (content of zip archive) which are on other host so I
need cache because,
if I set NullFilesCache on fsm exception is thrown:
org.apache.commons.vfs.FileSystemException: Could not list the contents of
"zip:http://..."
after I call getChilder()..

What is wrong with my code ?

Thanks in advance.

--
View this message in context: http://apache-commons.680414.n4.nabble.com/Files-in-temp-vfs-cache-are-not-deleted-after-read-zip-tp3475235p3475235.html
Sent from the Commons - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message