You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2019/01/24 23:46:00 UTC

[jira] [Updated] (VFS-677) [SFTP] Add support for append mode.

     [ https://issues.apache.org/jira/browse/VFS-677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory updated VFS-677:
-----------------------------
    Summary: [SFTP] Add support for append mode.  (was: [SFTP] The file type does not support append mode.)

> [SFTP] Add support for append mode.
> -----------------------------------
>
>                 Key: VFS-677
>                 URL: https://issues.apache.org/jira/browse/VFS-677
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.2
>         Environment: {code:java}
> <dependency>
>     <groupId>org.apache.commons</groupId>
>     <artifactId>commons-vfs2</artifactId>
>     <version>2.2</version>
> </dependency>
> {code}
>            Reporter: dingxbcn
>            Priority: Minor
>         Attachments: image-2018-10-25-11-10-10-799.png, image-2018-10-25-13-48-58-673.png, image-2018-10-25-13-49-13-334.png
>
>
> I am trying to append content to a sftp file. but vfs seems not supports that.
>  
> My test code: 
> {code:java}
> FileObject file = fsManager.resolveFile("sftp://root:xxx@192.168.1.1:22/sftpappend.txt" );
> if (!file.exists()) {
>     file.createFile();
> }
> FileContent content = file.getContent();
> OutputStream outputStream = content.getOutputStream(true);
> {code}
>  
> Error info :
> {code:java}
> org.apache.commons.vfs2.FileSystemException: The file type does not support append mode.
> at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream(AbstractFileObject.java:1180)
> at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream(DefaultFileContent.java:413)
> {code}
> I checked the source code. seems its easy to support APPEND option in sftp. {color:#FF0000}Why commons-vfs doesn't do that?{color}
> org.apache.commons.vfs2.provider.sftp.SftpFileObject#doGetOutputStream
> !image-2018-10-25-11-10-10-799.png!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)