You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "dingxbcn (JIRA)" <ji...@apache.org> on 2018/10/25 05:51:00 UTC
[jira] [Commented] (VFS-677) [VFS] [sftp] The file type does not
support append mode.
[ https://issues.apache.org/jira/browse/VFS-677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16663276#comment-16663276 ]
dingxbcn commented on VFS-677:
------------------------------
I changed 2 class then sftp APPEND mode works well.:P
!image-2018-10-25-13-48-58-673.png!
!image-2018-10-25-13-49-13-334.png!
> [VFS] [sftp] The file type does not support 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)