commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dingxbcn (JIRA)" <j...@apache.org>
Subject [jira] [Created] (VFS-677) [VFS] [sftp] The file type does not support append mode.
Date Thu, 25 Oct 2018 03:13:00 GMT
dingxbcn created VFS-677:
----------------------------

             Summary: [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
         Attachments: image-2018-10-25-11-10-10-799.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)

Mime
View raw message