1 /* 2 * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.net.ftp; 27 28 import java.io.*; 29 import java.net.*; 30 31 @SuppressWarnings({"unchecked", "deprecation", "all"}) 32 public abstract class FtpClient implements java.io.Closeable { 33 34 @dalvik.annotation.compat.UnsupportedAppUsage FtpClient()35 protected FtpClient() { 36 throw new RuntimeException("Stub!"); 37 } 38 defaultPort()39 public static final int defaultPort() { 40 throw new RuntimeException("Stub!"); 41 } 42 create()43 public static sun.net.ftp.FtpClient create() { 44 throw new RuntimeException("Stub!"); 45 } 46 create(java.net.InetSocketAddress dest)47 public static sun.net.ftp.FtpClient create(java.net.InetSocketAddress dest) 48 throws sun.net.ftp.FtpProtocolException, java.io.IOException { 49 throw new RuntimeException("Stub!"); 50 } 51 create(java.lang.String dest)52 public static sun.net.ftp.FtpClient create(java.lang.String dest) 53 throws sun.net.ftp.FtpProtocolException, java.io.IOException { 54 throw new RuntimeException("Stub!"); 55 } 56 enablePassiveMode(boolean passive)57 public abstract sun.net.ftp.FtpClient enablePassiveMode(boolean passive); 58 isPassiveModeEnabled()59 public abstract boolean isPassiveModeEnabled(); 60 setConnectTimeout(int timeout)61 public abstract sun.net.ftp.FtpClient setConnectTimeout(int timeout); 62 getConnectTimeout()63 public abstract int getConnectTimeout(); 64 setReadTimeout(int timeout)65 public abstract sun.net.ftp.FtpClient setReadTimeout(int timeout); 66 getReadTimeout()67 public abstract int getReadTimeout(); 68 setProxy(java.net.Proxy p)69 public abstract sun.net.ftp.FtpClient setProxy(java.net.Proxy p); 70 getProxy()71 public abstract java.net.Proxy getProxy(); 72 isConnected()73 public abstract boolean isConnected(); 74 connect(java.net.SocketAddress dest)75 public abstract sun.net.ftp.FtpClient connect(java.net.SocketAddress dest) 76 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 77 connect(java.net.SocketAddress dest, int timeout)78 public abstract sun.net.ftp.FtpClient connect(java.net.SocketAddress dest, int timeout) 79 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 80 getServerAddress()81 public abstract java.net.SocketAddress getServerAddress(); 82 login(java.lang.String user, char[] password)83 public abstract sun.net.ftp.FtpClient login(java.lang.String user, char[] password) 84 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 85 login( java.lang.String user, char[] password, java.lang.String account)86 public abstract sun.net.ftp.FtpClient login( 87 java.lang.String user, char[] password, java.lang.String account) 88 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 89 close()90 public abstract void close() throws java.io.IOException; 91 isLoggedIn()92 public abstract boolean isLoggedIn(); 93 changeDirectory(java.lang.String remoteDirectory)94 public abstract sun.net.ftp.FtpClient changeDirectory(java.lang.String remoteDirectory) 95 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 96 changeToParentDirectory()97 public abstract sun.net.ftp.FtpClient changeToParentDirectory() 98 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 99 getWorkingDirectory()100 public abstract java.lang.String getWorkingDirectory() 101 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 102 setRestartOffset(long offset)103 public abstract sun.net.ftp.FtpClient setRestartOffset(long offset); 104 getFile(java.lang.String name, java.io.OutputStream local)105 public abstract sun.net.ftp.FtpClient getFile(java.lang.String name, java.io.OutputStream local) 106 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 107 getFileStream(java.lang.String name)108 public abstract java.io.InputStream getFileStream(java.lang.String name) 109 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 110 putFileStream(java.lang.String name)111 public java.io.OutputStream putFileStream(java.lang.String name) 112 throws sun.net.ftp.FtpProtocolException, java.io.IOException { 113 throw new RuntimeException("Stub!"); 114 } 115 putFileStream(java.lang.String name, boolean unique)116 public abstract java.io.OutputStream putFileStream(java.lang.String name, boolean unique) 117 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 118 putFile(java.lang.String name, java.io.InputStream local)119 public sun.net.ftp.FtpClient putFile(java.lang.String name, java.io.InputStream local) 120 throws sun.net.ftp.FtpProtocolException, java.io.IOException { 121 throw new RuntimeException("Stub!"); 122 } 123 putFile( java.lang.String name, java.io.InputStream local, boolean unique)124 public abstract sun.net.ftp.FtpClient putFile( 125 java.lang.String name, java.io.InputStream local, boolean unique) 126 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 127 appendFile( java.lang.String name, java.io.InputStream local)128 public abstract sun.net.ftp.FtpClient appendFile( 129 java.lang.String name, java.io.InputStream local) 130 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 131 rename(java.lang.String from, java.lang.String to)132 public abstract sun.net.ftp.FtpClient rename(java.lang.String from, java.lang.String to) 133 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 134 deleteFile(java.lang.String name)135 public abstract sun.net.ftp.FtpClient deleteFile(java.lang.String name) 136 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 137 makeDirectory(java.lang.String name)138 public abstract sun.net.ftp.FtpClient makeDirectory(java.lang.String name) 139 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 140 removeDirectory(java.lang.String name)141 public abstract sun.net.ftp.FtpClient removeDirectory(java.lang.String name) 142 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 143 noop()144 public abstract sun.net.ftp.FtpClient noop() 145 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 146 getStatus(java.lang.String name)147 public abstract java.lang.String getStatus(java.lang.String name) 148 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 149 getFeatures()150 public abstract java.util.List<java.lang.String> getFeatures() 151 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 152 abort()153 public abstract sun.net.ftp.FtpClient abort() 154 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 155 completePending()156 public abstract sun.net.ftp.FtpClient completePending() 157 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 158 reInit()159 public abstract sun.net.ftp.FtpClient reInit() 160 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 161 setType(sun.net.ftp.FtpClient.TransferType type)162 public abstract sun.net.ftp.FtpClient setType(sun.net.ftp.FtpClient.TransferType type) 163 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 164 setBinaryType()165 public sun.net.ftp.FtpClient setBinaryType() 166 throws sun.net.ftp.FtpProtocolException, java.io.IOException { 167 throw new RuntimeException("Stub!"); 168 } 169 setAsciiType()170 public sun.net.ftp.FtpClient setAsciiType() 171 throws sun.net.ftp.FtpProtocolException, java.io.IOException { 172 throw new RuntimeException("Stub!"); 173 } 174 list(java.lang.String path)175 public abstract java.io.InputStream list(java.lang.String path) 176 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 177 nameList(java.lang.String path)178 public abstract java.io.InputStream nameList(java.lang.String path) 179 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 180 getSize(java.lang.String path)181 public abstract long getSize(java.lang.String path) 182 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 183 getLastModified(java.lang.String path)184 public abstract java.util.Date getLastModified(java.lang.String path) 185 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 186 setDirParser(sun.net.ftp.FtpDirParser p)187 public abstract sun.net.ftp.FtpClient setDirParser(sun.net.ftp.FtpDirParser p); 188 listFiles(java.lang.String path)189 public abstract java.util.Iterator<sun.net.ftp.FtpDirEntry> listFiles(java.lang.String path) 190 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 191 useKerberos()192 public abstract sun.net.ftp.FtpClient useKerberos() 193 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 194 getWelcomeMsg()195 public abstract java.lang.String getWelcomeMsg(); 196 getLastReplyCode()197 public abstract sun.net.ftp.FtpReplyCode getLastReplyCode(); 198 getLastResponseString()199 public abstract java.lang.String getLastResponseString(); 200 getLastTransferSize()201 public abstract long getLastTransferSize(); 202 getLastFileName()203 public abstract java.lang.String getLastFileName(); 204 startSecureSession()205 public abstract sun.net.ftp.FtpClient startSecureSession() 206 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 207 endSecureSession()208 public abstract sun.net.ftp.FtpClient endSecureSession() 209 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 210 allocate(long size)211 public abstract sun.net.ftp.FtpClient allocate(long size) 212 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 213 structureMount(java.lang.String struct)214 public abstract sun.net.ftp.FtpClient structureMount(java.lang.String struct) 215 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 216 getSystem()217 public abstract java.lang.String getSystem() 218 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 219 getHelp(java.lang.String cmd)220 public abstract java.lang.String getHelp(java.lang.String cmd) 221 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 222 siteCmd(java.lang.String cmd)223 public abstract sun.net.ftp.FtpClient siteCmd(java.lang.String cmd) 224 throws sun.net.ftp.FtpProtocolException, java.io.IOException; 225 226 private static final int FTP_PORT = 21; // 0x15 227 228 @SuppressWarnings({"unchecked", "deprecation", "all"}) 229 public static enum TransferType { 230 ASCII, 231 BINARY, 232 EBCDIC; 233 TransferType()234 private TransferType() { 235 throw new RuntimeException("Stub!"); 236 } 237 } 238 } 239