| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc (build 1.5.0_12) on Tue Apr 01 14:48:49 CEST 2008 --> |
| <TITLE> |
| SFTPv3Client |
| </TITLE> |
| |
| <META NAME="keywords" CONTENT="com.trilead.ssh2.SFTPv3Client class"> |
| |
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> |
| |
| <SCRIPT type="text/javascript"> |
| function windowTitle() |
| { |
| parent.document.title="SFTPv3Client"; |
| } |
| </SCRIPT> |
| <NOSCRIPT> |
| </NOSCRIPT> |
| |
| </HEAD> |
| |
| <BODY BGCOLOR="white" onload="windowTitle();"> |
| |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../com/trilead/ssh2/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SFTPv3Client.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| Trilead SSH-2 for Java</EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../com/trilead/ssh2/SFTPException.html" title="class in com.trilead.ssh2"><B>PREV CLASS</B></A> |
| <A HREF="../../../com/trilead/ssh2/SFTPv3DirectoryEntry.html" title="class in com.trilead.ssh2"><B>NEXT CLASS</B></A></FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../index.html?com/trilead/ssh2/SFTPv3Client.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="SFTPv3Client.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| com.trilead.ssh2</FONT> |
| <BR> |
| Class SFTPv3Client</H2> |
| <PRE> |
| java.lang.Object |
| <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.trilead.ssh2.SFTPv3Client</B> |
| </PRE> |
| <HR> |
| <DL> |
| <DT><PRE>public class <B>SFTPv3Client</B><DT>extends java.lang.Object</DL> |
| </PRE> |
| |
| <P> |
| A <code>SFTPv3Client</code> represents a SFTP (protocol version 3) |
| client connection tunnelled over a SSH-2 connection. This is a very simple |
| (synchronous) implementation. |
| <p> |
| Basically, most methods in this class map directly to one of |
| the packet types described in draft-ietf-secsh-filexfer-02.txt. |
| <p> |
| Note: this is experimental code. |
| <p> |
| Error handling: the methods of this class throw IOExceptions. However, unless |
| there is catastrophic failure, exceptions of the type <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>SFTPv3Client</CODE></A> will |
| be thrown (a subclass of IOException). Therefore, you can implement more verbose |
| behavior by checking if a thrown exception if of this type. If yes, then you |
| can cast the exception and access detailed information about the failure. |
| <p> |
| Notes about file names, directory names and paths, copy-pasted |
| from the specs: |
| <ul> |
| <li>SFTP v3 represents file names as strings. File names are |
| assumed to use the slash ('/') character as a directory separator.</li> |
| <li>File names starting with a slash are "absolute", and are relative to |
| the root of the file system. Names starting with any other character |
| are relative to the user's default directory (home directory).</li> |
| <li>Servers SHOULD interpret a path name component ".." as referring to |
| the parent directory, and "." as referring to the current directory. |
| If the server implementation limits access to certain parts of the |
| file system, it must be extra careful in parsing file names when |
| enforcing such restrictions. There have been numerous reported |
| security bugs where a ".." in a path name has allowed access outside |
| the intended area.</li> |
| <li>An empty path name is valid, and it refers to the user's default |
| directory (usually the user's home directory).</li> |
| </ul> |
| <p> |
| If you are still not tired then please go on and read the comment for |
| <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#setCharset(java.lang.String)"><CODE>setCharset(String)</CODE></A>. |
| <P> |
| |
| <P> |
| <DL> |
| <DT><B>Version:</B></DT> |
| <DD>$Id: SFTPv3Client.java,v 1.3 2008/04/01 12:38:09 cplattne Exp $</DD> |
| <DT><B>Author:</B></DT> |
| <DD>Christian Plattner, plattner@trilead.com</DD> |
| </DL> |
| <HR> |
| |
| <P> |
| |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| |
| <A NAME="constructor_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Constructor Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#SFTPv3Client(com.trilead.ssh2.Connection)">SFTPv3Client</A></B>(<A HREF="../../../com/trilead/ssh2/Connection.html" title="class in com.trilead.ssh2">Connection</A> conn)</CODE> |
| |
| <BR> |
| Create a SFTP v3 client.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#SFTPv3Client(com.trilead.ssh2.Connection, java.io.PrintStream)">SFTPv3Client</A></B>(<A HREF="../../../com/trilead/ssh2/Connection.html" title="class in com.trilead.ssh2">Connection</A> conn, |
| java.io.PrintStream debug)</CODE> |
| |
| <BR> |
| <B>Deprecated.</B> <I>this constructor (debug version) will disappear in the future, |
| use <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#SFTPv3Client(com.trilead.ssh2.Connection)"><CODE>SFTPv3Client(Connection)</CODE></A> instead.</I></TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#canonicalPath(java.lang.String)">canonicalPath</A></B>(java.lang.String path)</CODE> |
| |
| <BR> |
| Have the server canonicalize any given path name to an absolute path.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#close()">close</A></B>()</CODE> |
| |
| <BR> |
| Close this SFTP session.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#closeFile(com.trilead.ssh2.SFTPv3FileHandle)">closeFile</A></B>(<A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> handle)</CODE> |
| |
| <BR> |
| Close a file.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#createFile(java.lang.String)">createFile</A></B>(java.lang.String fileName)</CODE> |
| |
| <BR> |
| Create a file and open it for reading and writing.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#createFile(java.lang.String, com.trilead.ssh2.SFTPv3FileAttributes)">createFile</A></B>(java.lang.String fileName, |
| <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> attr)</CODE> |
| |
| <BR> |
| Create a file and open it for reading and writing.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#createFileTruncate(java.lang.String)">createFileTruncate</A></B>(java.lang.String fileName)</CODE> |
| |
| <BR> |
| Create a file (truncate it if it already exists) and open it for reading and writing.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#createFileTruncate(java.lang.String, com.trilead.ssh2.SFTPv3FileAttributes)">createFileTruncate</A></B>(java.lang.String fileName, |
| <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> attr)</CODE> |
| |
| <BR> |
| reate a file (truncate it if it already exists) and open it for reading and writing.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#createSymlink(java.lang.String, java.lang.String)">createSymlink</A></B>(java.lang.String src, |
| java.lang.String target)</CODE> |
| |
| <BR> |
| Create a symbolic link on the server.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#fsetstat(com.trilead.ssh2.SFTPv3FileHandle, com.trilead.ssh2.SFTPv3FileAttributes)">fsetstat</A></B>(<A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> handle, |
| <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> attr)</CODE> |
| |
| <BR> |
| Modify the attributes of a file.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#fstat(com.trilead.ssh2.SFTPv3FileHandle)">fstat</A></B>(<A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> handle)</CODE> |
| |
| <BR> |
| Retrieve the file attributes of an open file.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#getCharset()">getCharset</A></B>()</CODE> |
| |
| <BR> |
| The currently used charset for filename encoding/decoding.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#getProtocolVersion()">getProtocolVersion</A></B>()</CODE> |
| |
| <BR> |
| Returns the negotiated SFTP protocol version between the client and the server.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.util.Vector</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#ls(java.lang.String)">ls</A></B>(java.lang.String dirName)</CODE> |
| |
| <BR> |
| List the contents of a directory.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#lstat(java.lang.String)">lstat</A></B>(java.lang.String path)</CODE> |
| |
| <BR> |
| Retrieve the file attributes of a file.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#mkdir(java.lang.String, int)">mkdir</A></B>(java.lang.String dirName, |
| int posixPermissions)</CODE> |
| |
| <BR> |
| Create a new directory.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#mv(java.lang.String, java.lang.String)">mv</A></B>(java.lang.String oldPath, |
| java.lang.String newPath)</CODE> |
| |
| <BR> |
| Move a file or directory.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#openFileRO(java.lang.String)">openFileRO</A></B>(java.lang.String fileName)</CODE> |
| |
| <BR> |
| Open a file for reading.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#openFileRW(java.lang.String)">openFileRW</A></B>(java.lang.String fileName)</CODE> |
| |
| <BR> |
| Open a file for reading and writing.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#read(com.trilead.ssh2.SFTPv3FileHandle, long, byte[], int, int)">read</A></B>(<A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> handle, |
| long fileOffset, |
| byte[] dst, |
| int dstoff, |
| int len)</CODE> |
| |
| <BR> |
| Read bytes from a file.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#readLink(java.lang.String)">readLink</A></B>(java.lang.String path)</CODE> |
| |
| <BR> |
| Read the target of a symbolic link.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#rm(java.lang.String)">rm</A></B>(java.lang.String fileName)</CODE> |
| |
| <BR> |
| Remove a file.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#rmdir(java.lang.String)">rmdir</A></B>(java.lang.String dirName)</CODE> |
| |
| <BR> |
| Remove an empty directory.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#setCharset(java.lang.String)">setCharset</A></B>(java.lang.String charset)</CODE> |
| |
| <BR> |
| Set the charset used to convert between Java Unicode Strings and byte encodings |
| used by the server for paths and file names.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#setstat(java.lang.String, com.trilead.ssh2.SFTPv3FileAttributes)">setstat</A></B>(java.lang.String path, |
| <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> attr)</CODE> |
| |
| <BR> |
| Modify the attributes of a file.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#stat(java.lang.String)">stat</A></B>(java.lang.String path)</CODE> |
| |
| <BR> |
| Retrieve the file attributes of a file.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#write(com.trilead.ssh2.SFTPv3FileHandle, long, byte[], int, int)">write</A></B>(<A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> handle, |
| long fileOffset, |
| byte[] src, |
| int srcoff, |
| int len)</CODE> |
| |
| <BR> |
| Write bytes to a file.</TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| |
| <A NAME="constructor_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Constructor Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="SFTPv3Client(com.trilead.ssh2.Connection, java.io.PrintStream)"><!-- --></A><H3> |
| SFTPv3Client</H3> |
| <PRE> |
| public <B>SFTPv3Client</B>(<A HREF="../../../com/trilead/ssh2/Connection.html" title="class in com.trilead.ssh2">Connection</A> conn, |
| java.io.PrintStream debug) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD><B>Deprecated.</B> <I>this constructor (debug version) will disappear in the future, |
| use <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#SFTPv3Client(com.trilead.ssh2.Connection)"><CODE>SFTPv3Client(Connection)</CODE></A> instead.</I> |
| <P> |
| <DD>Create a SFTP v3 client. |
| <P> |
| <DL> |
| <DT><B>Parameters:</B><DD><CODE>conn</CODE> - The underlying SSH-2 connection to be used.<DD><CODE>debug</CODE> - |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DL> |
| <HR> |
| |
| <A NAME="SFTPv3Client(com.trilead.ssh2.Connection)"><!-- --></A><H3> |
| SFTPv3Client</H3> |
| <PRE> |
| public <B>SFTPv3Client</B>(<A HREF="../../../com/trilead/ssh2/Connection.html" title="class in com.trilead.ssh2">Connection</A> conn) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Create a SFTP v3 client. |
| <P> |
| <DL> |
| <DT><B>Parameters:</B><DD><CODE>conn</CODE> - The underlying SSH-2 connection to be used. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DL> |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="setCharset(java.lang.String)"><!-- --></A><H3> |
| setCharset</H3> |
| <PRE> |
| public void <B>setCharset</B>(java.lang.String charset) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Set the charset used to convert between Java Unicode Strings and byte encodings |
| used by the server for paths and file names. Unfortunately, the SFTP v3 draft |
| says NOTHING about such conversions (well, with the exception of error messages |
| which have to be in UTF-8). Newer drafts specify to use UTF-8 for file names |
| (if I remember correctly). However, a quick test using OpenSSH serving a EXT-3 |
| filesystem has shown that UTF-8 seems to be a bad choice for SFTP v3 (tested with |
| filenames containing german umlauts). "windows-1252" seems to work better for Europe. |
| Luckily, "windows-1252" is the platform default in my case =). |
| <p> |
| If you don't set anything, then the platform default will be used (this is the default |
| behavior). |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>charset</CODE> - the name of the charset to be used or <code>null</code> to use the platform's |
| default encoding. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE><DT><B>See Also:</B><DD><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#getCharset()"><CODE>getCharset()</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getCharset()"><!-- --></A><H3> |
| getCharset</H3> |
| <PRE> |
| public java.lang.String <B>getCharset</B>()</PRE> |
| <DL> |
| <DD>The currently used charset for filename encoding/decoding. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>The name of the charset (<code>null</code> if the platform's default charset is being used)<DT><B>See Also:</B><DD><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#setCharset(java.lang.String)"><CODE>setCharset(String)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="fstat(com.trilead.ssh2.SFTPv3FileHandle)"><!-- --></A><H3> |
| fstat</H3> |
| <PRE> |
| public <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> <B>fstat</B>(<A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> handle) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Retrieve the file attributes of an open file. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>handle</CODE> - a SFTPv3FileHandle handle. |
| <DT><B>Returns:</B><DD>a SFTPv3FileAttributes object. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="stat(java.lang.String)"><!-- --></A><H3> |
| stat</H3> |
| <PRE> |
| public <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> <B>stat</B>(java.lang.String path) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Retrieve the file attributes of a file. This method |
| follows symbolic links on the server. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>path</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Returns:</B><DD>a SFTPv3FileAttributes object. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE><DT><B>See Also:</B><DD><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#lstat(java.lang.String)"><CODE>lstat(String)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="lstat(java.lang.String)"><!-- --></A><H3> |
| lstat</H3> |
| <PRE> |
| public <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> <B>lstat</B>(java.lang.String path) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Retrieve the file attributes of a file. This method |
| does NOT follow symbolic links on the server. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>path</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Returns:</B><DD>a SFTPv3FileAttributes object. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE><DT><B>See Also:</B><DD><A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#stat(java.lang.String)"><CODE>stat(String)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="readLink(java.lang.String)"><!-- --></A><H3> |
| readLink</H3> |
| <PRE> |
| public java.lang.String <B>readLink</B>(java.lang.String path) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Read the target of a symbolic link. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>path</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Returns:</B><DD>The target of the link. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setstat(java.lang.String, com.trilead.ssh2.SFTPv3FileAttributes)"><!-- --></A><H3> |
| setstat</H3> |
| <PRE> |
| public void <B>setstat</B>(java.lang.String path, |
| <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> attr) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Modify the attributes of a file. Used for operations such as changing |
| the ownership, permissions or access times, as well as for truncating a file. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>path</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details.<DD><CODE>attr</CODE> - A SFTPv3FileAttributes object. Specifies the modifications to be |
| made to the attributes of the file. Empty fields will be ignored. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="fsetstat(com.trilead.ssh2.SFTPv3FileHandle, com.trilead.ssh2.SFTPv3FileAttributes)"><!-- --></A><H3> |
| fsetstat</H3> |
| <PRE> |
| public void <B>fsetstat</B>(<A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> handle, |
| <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> attr) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Modify the attributes of a file. Used for operations such as changing |
| the ownership, permissions or access times, as well as for truncating a file. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>handle</CODE> - a SFTPv3FileHandle handle<DD><CODE>attr</CODE> - A SFTPv3FileAttributes object. Specifies the modifications to be |
| made to the attributes of the file. Empty fields will be ignored. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="createSymlink(java.lang.String, java.lang.String)"><!-- --></A><H3> |
| createSymlink</H3> |
| <PRE> |
| public void <B>createSymlink</B>(java.lang.String src, |
| java.lang.String target) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Create a symbolic link on the server. Creates a link "src" that points |
| to "target". |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>src</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details.<DD><CODE>target</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="canonicalPath(java.lang.String)"><!-- --></A><H3> |
| canonicalPath</H3> |
| <PRE> |
| public java.lang.String <B>canonicalPath</B>(java.lang.String path) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Have the server canonicalize any given path name to an absolute path. |
| This is useful for converting path names containing ".." components or |
| relative pathnames without a leading slash into absolute paths. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>path</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Returns:</B><DD>An absolute path. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getProtocolVersion()"><!-- --></A><H3> |
| getProtocolVersion</H3> |
| <PRE> |
| public int <B>getProtocolVersion</B>()</PRE> |
| <DL> |
| <DD>Returns the negotiated SFTP protocol version between the client and the server. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>SFTP protocol version, i.e., "3".</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="close()"><!-- --></A><H3> |
| close</H3> |
| <PRE> |
| public void <B>close</B>()</PRE> |
| <DL> |
| <DD>Close this SFTP session. NEVER forget to call this method to free up |
| resources - even if you got an exception from one of the other methods. |
| Sometimes these other methods may throw an exception, saying that the |
| underlying channel is closed (this can happen, e.g., if the other server |
| sent a close message.) However, as long as you have not called the |
| <code>close()</code> method, you are likely wasting resources. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="ls(java.lang.String)"><!-- --></A><H3> |
| ls</H3> |
| <PRE> |
| public java.util.Vector <B>ls</B>(java.lang.String dirName) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>List the contents of a directory. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>dirName</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Returns:</B><DD>A Vector containing <A HREF="../../../com/trilead/ssh2/SFTPv3DirectoryEntry.html" title="class in com.trilead.ssh2"><CODE>SFTPv3DirectoryEntry</CODE></A> objects. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="mkdir(java.lang.String, int)"><!-- --></A><H3> |
| mkdir</H3> |
| <PRE> |
| public void <B>mkdir</B>(java.lang.String dirName, |
| int posixPermissions) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Create a new directory. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>dirName</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details.<DD><CODE>posixPermissions</CODE> - the permissions for this directory, e.g., "0700" (remember that |
| this is octal noation). The server will likely apply a umask. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="rm(java.lang.String)"><!-- --></A><H3> |
| rm</H3> |
| <PRE> |
| public void <B>rm</B>(java.lang.String fileName) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Remove a file. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>fileName</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="rmdir(java.lang.String)"><!-- --></A><H3> |
| rmdir</H3> |
| <PRE> |
| public void <B>rmdir</B>(java.lang.String dirName) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Remove an empty directory. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>dirName</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="mv(java.lang.String, java.lang.String)"><!-- --></A><H3> |
| mv</H3> |
| <PRE> |
| public void <B>mv</B>(java.lang.String oldPath, |
| java.lang.String newPath) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Move a file or directory. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>oldPath</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details.<DD><CODE>newPath</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="openFileRO(java.lang.String)"><!-- --></A><H3> |
| openFileRO</H3> |
| <PRE> |
| public <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> <B>openFileRO</B>(java.lang.String fileName) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Open a file for reading. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>fileName</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Returns:</B><DD>a SFTPv3FileHandle handle |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="openFileRW(java.lang.String)"><!-- --></A><H3> |
| openFileRW</H3> |
| <PRE> |
| public <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> <B>openFileRW</B>(java.lang.String fileName) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Open a file for reading and writing. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>fileName</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Returns:</B><DD>a SFTPv3FileHandle handle |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="createFile(java.lang.String)"><!-- --></A><H3> |
| createFile</H3> |
| <PRE> |
| public <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> <B>createFile</B>(java.lang.String fileName) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Create a file and open it for reading and writing. |
| Same as <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#createFile(java.lang.String, com.trilead.ssh2.SFTPv3FileAttributes)"><CODE>createFile(fileName, null)</CODE></A>. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>fileName</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Returns:</B><DD>a SFTPv3FileHandle handle |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="createFile(java.lang.String, com.trilead.ssh2.SFTPv3FileAttributes)"><!-- --></A><H3> |
| createFile</H3> |
| <PRE> |
| public <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> <B>createFile</B>(java.lang.String fileName, |
| <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> attr) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>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). |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>fileName</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details.<DD><CODE>attr</CODE> - 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 <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2"><CODE>SFTPv3FileHandle</CODE></A> |
| structure make sense. You need only to set those fields where you want |
| to override the server's defaults. |
| <DT><B>Returns:</B><DD>a SFTPv3FileHandle handle |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="createFileTruncate(java.lang.String)"><!-- --></A><H3> |
| createFileTruncate</H3> |
| <PRE> |
| public <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> <B>createFileTruncate</B>(java.lang.String fileName) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Create a file (truncate it if it already exists) and open it for reading and writing. |
| Same as <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html#createFileTruncate(java.lang.String, com.trilead.ssh2.SFTPv3FileAttributes)"><CODE>createFileTruncate(fileName, null)</CODE></A>. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>fileName</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details. |
| <DT><B>Returns:</B><DD>a SFTPv3FileHandle handle |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="createFileTruncate(java.lang.String, com.trilead.ssh2.SFTPv3FileAttributes)"><!-- --></A><H3> |
| createFileTruncate</H3> |
| <PRE> |
| public <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> <B>createFileTruncate</B>(java.lang.String fileName, |
| <A HREF="../../../com/trilead/ssh2/SFTPv3FileAttributes.html" title="class in com.trilead.ssh2">SFTPv3FileAttributes</A> attr) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>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). |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>fileName</CODE> - See the <A HREF="../../../com/trilead/ssh2/SFTPv3Client.html" title="class in com.trilead.ssh2"><CODE>comment</CODE></A> for the class for more details.<DD><CODE>attr</CODE> - 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 <A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2"><CODE>SFTPv3FileHandle</CODE></A> |
| structure make sense. You need only to set those fields where you want |
| to override the server's defaults. |
| <DT><B>Returns:</B><DD>a SFTPv3FileHandle handle |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="read(com.trilead.ssh2.SFTPv3FileHandle, long, byte[], int, int)"><!-- --></A><H3> |
| read</H3> |
| <PRE> |
| public int <B>read</B>(<A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> handle, |
| long fileOffset, |
| byte[] dst, |
| int dstoff, |
| int len) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Read bytes from a file. No more than 32768 bytes may be read at once. |
| Be aware that the semantics of read() are different than for Java streams. |
| <p> |
| <ul> |
| <li>The server will read as many bytes as it can from the file (up to <code>len</code>), |
| and return them.</li> |
| <li>If EOF is encountered before reading any data, <code>-1</code> is returned. |
| <li>If an error occurs, an exception is thrown</li>. |
| <li>For normal disk files, it is guaranteed that the server will return the specified |
| number of bytes, or up to end of file. For, e.g., device files this may return |
| fewer bytes than requested.</li> |
| </ul> |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>handle</CODE> - a SFTPv3FileHandle handle<DD><CODE>fileOffset</CODE> - offset (in bytes) in the file<DD><CODE>dst</CODE> - the destination byte array<DD><CODE>dstoff</CODE> - offset in the destination byte array<DD><CODE>len</CODE> - how many bytes to read, 0 < len <= 32768 bytes |
| <DT><B>Returns:</B><DD>the number of bytes that could be read, may be less than requested if |
| the end of the file is reached, -1 is returned in case of <code>EOF</code> |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="write(com.trilead.ssh2.SFTPv3FileHandle, long, byte[], int, int)"><!-- --></A><H3> |
| write</H3> |
| <PRE> |
| public void <B>write</B>(<A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> handle, |
| long fileOffset, |
| byte[] src, |
| int srcoff, |
| int len) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Write bytes to a file. If <code>len</code> > 32768, then the write operation will |
| be split into multiple writes. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>handle</CODE> - a SFTPv3FileHandle handle.<DD><CODE>fileOffset</CODE> - offset (in bytes) in the file.<DD><CODE>src</CODE> - the source byte array.<DD><CODE>srcoff</CODE> - offset in the source byte array.<DD><CODE>len</CODE> - how many bytes to write. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="closeFile(com.trilead.ssh2.SFTPv3FileHandle)"><!-- --></A><H3> |
| closeFile</H3> |
| <PRE> |
| public void <B>closeFile</B>(<A HREF="../../../com/trilead/ssh2/SFTPv3FileHandle.html" title="class in com.trilead.ssh2">SFTPv3FileHandle</A> handle) |
| throws java.io.IOException</PRE> |
| <DL> |
| <DD>Close a file. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>handle</CODE> - a SFTPv3FileHandle handle |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../com/trilead/ssh2/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SFTPv3Client.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| Trilead SSH-2 for Java</EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../com/trilead/ssh2/SFTPException.html" title="class in com.trilead.ssh2"><B>PREV CLASS</B></A> |
| <A HREF="../../../com/trilead/ssh2/SFTPv3DirectoryEntry.html" title="class in com.trilead.ssh2"><B>NEXT CLASS</B></A></FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../index.html?com/trilead/ssh2/SFTPv3Client.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="SFTPv3Client.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| |
| <HR> |
| |
| </BODY> |
| </HTML> |