/** * Open a file for reading. * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileRO(String fileName) throws IOException { return openFile(fileName, SSH_FXF_READ, null); }
/** * Open a file for reading. * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileRO(String fileName) throws IOException { return openFile(fileName, 0x00000001, null); // SSH_FXF_READ }
/** * Open a file for reading and writing. * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileRW(String fileName) throws IOException { return openFile(fileName, 0x00000003, null); // SSH_FXF_READ | SSH_FXF_WRITE }
/** * Open a file for reading. * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileRO(String fileName) throws IOException { return openFile(fileName, SSH_FXF_READ, null); }
/** * Open a file for reading and writing. * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileRW(String fileName) throws IOException { return openFile(fileName, SSH_FXF_READ | SSH_FXF_WRITE, null); }
/** * Open a file for reading and writing. * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileRW(String fileName) throws IOException { return openFile(fileName, SSH_FXF_READ | SSH_FXF_WRITE, null); }
/** * Open a file for reading. * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileRO(String fileName) throws IOException { return openFile(fileName, SSH_FXF_READ, null); }
/** * Open a file for reading and writing. * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileRW(String fileName) throws IOException { return openFile(fileName, SSH_FXF_READ | SSH_FXF_WRITE, null); }
/** * Create a file and open it for reading and writing. * You can specify the default attributes of the file (the server may or may * not respect your wishes). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @param attr may be <code>null</code> to use server defaults. Probably only * the <code>uid</code>, <code>gid</code> and <code>permissions</code> * (remember the server may apply a umask) entries of the {@link SFTPv3FileHandle} * structure make sense. You need only to set those fields where you want * to override the server's defaults. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle createFile(String fileName, SFTPv3FileAttributes attr) throws IOException { return openFile(fileName, SSH_FXF_CREAT | SSH_FXF_READ | SSH_FXF_WRITE, attr); }
/** * Create a file and open it for reading and writing. * You can specify the default attributes of the file (the server may or may * not respect your wishes). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @param attr may be <code>null</code> to use server defaults. Probably only * the <code>uid</code>, <code>gid</code> and <code>permissions</code> * (remember the server may apply a umask) entries of the {@link SFTPv3FileHandle} * structure make sense. You need only to set those fields where you want * to override the server's defaults. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle createFile(String fileName, SFTPv3FileAttributes attr) throws IOException { return openFile(fileName, SSH_FXF_CREAT | SSH_FXF_READ | SSH_FXF_WRITE, attr); }
/** * Open a file in append mode. The SFTP v3 draft says nothing but assuming normal POSIX * behavior, all writes will be appendend to the end of the file, no matter which offset * one specifies. * <p/> * A side note for the curious: OpenSSH does an lseek() to the specified writing offset before each write(), * even for writes to files opened in O_APPEND mode. However, bear in mind that when working * in the O_APPEND mode, each write() includes an implicit lseek() to the end of the file * (well, this is what the newsgroups say). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileRWAppend(String fileName) throws IOException { return openFile(fileName, SSH_FXF_READ | SSH_FXF_WRITE | SSH_FXF_APPEND, null); }
/** * Create a file and open it for reading and writing. * You can specify the default attributes of the file (the server may or may * not respect your wishes). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @param attr may be <code>null</code> to use server defaults. Probably only * the <code>uid</code>, <code>gid</code> and <code>permissions</code> * (remember the server may apply a umask) entries of the {@link SFTPv3FileHandle} * structure make sense. You need only to set those fields where you want * to override the server's defaults. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle createFile(String fileName, SFTPv3FileAttributes attr) throws IOException { return openFile(fileName, SSH_FXF_CREAT | SSH_FXF_READ | SSH_FXF_WRITE, attr); }
/** * Open a file in append mode. The SFTP v3 draft says nothing but assuming normal POSIX * behavior, all writes will be appendend to the end of the file, no matter which offset * one specifies. * <p/> * A side note for the curious: OpenSSH does an lseek() to the specified writing offset before each write(), * even for writes to files opened in O_APPEND mode. However, bear in mind that when working * in the O_APPEND mode, each write() includes an implicit lseek() to the end of the file * (well, this is what the newsgroups say). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileRWAppend(String fileName) throws IOException { return openFile(fileName, SSH_FXF_READ | SSH_FXF_WRITE | SSH_FXF_APPEND, null); }
/** * Open a file in append mode. The SFTP v3 draft says nothing but assuming normal POSIX * behavior, all writes will be appendend to the end of the file, no matter which offset * one specifies. * <p/> * A side note for the curious: OpenSSH does an lseek() to the specified writing offset before each write(), * even for writes to files opened in O_APPEND mode. However, bear in mind that when working * in the O_APPEND mode, each write() includes an implicit lseek() to the end of the file * (well, this is what the newsgroups say). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileWAppend(String fileName) throws IOException { return openFile(fileName, SSH_FXF_WRITE | SSH_FXF_APPEND, null); }
/** * reate a file (truncate it if it already exists) and open it for reading and writing. * You can specify the default attributes of the file (the server may or may * not respect your wishes). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @param attr may be <code>null</code> to use server defaults. Probably only * the <code>uid</code>, <code>gid</code> and <code>permissions</code> * (remember the server may apply a umask) entries of the {@link SFTPv3FileHandle} * structure make sense. You need only to set those fields where you want * to override the server's defaults. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle createFileTruncate(String fileName, SFTPv3FileAttributes attr) throws IOException { return openFile(fileName, 0x00000018 | 0x00000003, attr); // SSH_FXF_CREAT | SSH_FXF_TRUNC | SSH_FXF_READ | SSH_FXF_WRITE }
/** * Open a file in append mode. The SFTP v3 draft says nothing but assuming normal POSIX * behavior, all writes will be appendend to the end of the file, no matter which offset * one specifies. * <p/> * A side note for the curious: OpenSSH does an lseek() to the specified writing offset before each write(), * even for writes to files opened in O_APPEND mode. However, bear in mind that when working * in the O_APPEND mode, each write() includes an implicit lseek() to the end of the file * (well, this is what the newsgroups say). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileWAppend(String fileName) throws IOException { return openFile(fileName, SSH_FXF_WRITE | SSH_FXF_APPEND, null); }
/** * reate a file (truncate it if it already exists) and open it for writing. * You can specify the default attributes of the file (the server may or may * not respect your wishes). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @param attr may be <code>null</code> to use server defaults. Probably only * the <code>uid</code>, <code>gid</code> and <code>permissions</code> * (remember the server may apply a umask) entries of the {@link SFTPv3FileHandle} * structure make sense. You need only to set those fields where you want * to override the server's defaults. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle createFileTruncate(String fileName, SFTPv3FileAttributes attr) throws IOException { return openFile(fileName, SSH_FXF_CREAT | SSH_FXF_TRUNC | SSH_FXF_WRITE, attr); }
/** * Create a file and open it for reading and writing. * You can specify the default attributes of the file (the server may or may * not respect your wishes). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @param attr may be <code>null</code> to use server defaults. Probably only * the <code>uid</code>, <code>gid</code> and <code>permissions</code> * (remember the server may apply a umask) entries of the {@link SFTPv3FileHandle} * structure make sense. You need only to set those fields where you want * to override the server's defaults. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle createFile(String fileName, SFTPv3FileAttributes attr) throws IOException { return openFile(fileName, 0x00000008 | 0x00000003, attr); // SSH_FXF_CREAT | SSH_FXF_READ | SSH_FXF_WRITE }
/** * reate a file (truncate it if it already exists) and open it for writing. * You can specify the default attributes of the file (the server may or may * not respect your wishes). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @param attr may be <code>null</code> to use server defaults. Probably only * the <code>uid</code>, <code>gid</code> and <code>permissions</code> * (remember the server may apply a umask) entries of the {@link SFTPv3FileHandle} * structure make sense. You need only to set those fields where you want * to override the server's defaults. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle createFileTruncate(String fileName, SFTPv3FileAttributes attr) throws IOException { return openFile(fileName, SSH_FXF_CREAT | SSH_FXF_TRUNC | SSH_FXF_WRITE, attr); }
/** * Open a file in append mode. The SFTP v3 draft says nothing but assuming normal POSIX * behavior, all writes will be appendend to the end of the file, no matter which offset * one specifies. * <p/> * A side note for the curious: OpenSSH does an lseek() to the specified writing offset before each write(), * even for writes to files opened in O_APPEND mode. However, bear in mind that when working * in the O_APPEND mode, each write() includes an implicit lseek() to the end of the file * (well, this is what the newsgroups say). * * @param fileName See the {@link SFTPv3Client comment} for the class for more details. * @return a SFTPv3FileHandle handle * @throws IOException */ public SFTPv3FileHandle openFileWAppend(String fileName) throws IOException { return openFile(fileName, SSH_FXF_WRITE | SSH_FXF_APPEND, null); }