[VFS] can I do a remote file append?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[VFS] can I do a remote file append?

manco
Hi all,
 
I set up a nice little package that I can use to transfer files between locations,
based on an xml config file. I still have a few bugs with connecting to some sftp sites
but other than that is works quite nicely.
 
However now I have a new requirement, append to a remote file.
I just went down the path of doing this in 3 steps, first copy/move the remote file
to my local filesystem. Second, open the file in append mode and append data from
zero or more local files, (not sure which is better, FileChannels or streams here) close
the file. Lastly copy/move the file back to the original remote location.
 
Then I saw in the VFS javadoc
  FileObject.getFileContent().getOuputStream(boolean Append) ...
 
Is there some combination of FileContent that I can use to do a "remote" append, for
sftp, ftp, smb and file?
 
Thanks,
Manco

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] can I do a remote file append?

Mario Ivankovits-2
Am Do 26.05.2005 23:41 schrieb manco <[hidden email]>:

> Then I saw in the VFS javadoc
>   FileObject.getFileContent().getOuputStream(boolean Append) ...
>  
> Is there some combination of FileContent that I can use to do a
> "remote" append, for
> sftp, ftp, smb and file?

If the filesystem do have the capability Capability.APPEND_CONTENT it is
possible to directly open the remote file in "append mode".
However, the input stream used to read the file and the output stream to
append to the file is always routed through your JVM.
VFS do not provide a method to do this completley remote.

However, if you use the append mode you avoid to copy the file around.
If a filesystem do not provide this capability you have to fallback to
your solution.

---
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]