congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FtpURLConnection.getReply
Code IndexAdd Tabnine to your IDE (free)

How to use
getReply
method
in
libcore.net.url.FtpURLConnection

Best Java code snippets using libcore.net.url.FtpURLConnection.getReply (Showing top 20 results out of 315)

origin: robovm/robovm

/**
 * Set the type of the file transfer. Only Image is supported
 */
private void setType() throws IOException {
  write("TYPE I\r\n");
  if (getReply() != FTP_OK) {
    throw new IOException("Unable to set transfer type");
  }
}
origin: robovm/robovm

private void getFile() throws IOException {
  int reply;
  String file = url.getFile();
  write("RETR " + file + "\r\n");
  reply = getReply();
  if (reply == FTP_NOTFOUND && file.length() > 0 && file.charAt(0) == '/') {
    write("RETR " + file.substring(1) + "\r\n");
    reply = getReply();
  }
  if (!(reply == FTP_OPENDATA || reply == FTP_TRANSFEROK)) {
    throw new FileNotFoundException("Unable to retrieve file: " + reply);
  }
}
origin: robovm/robovm

private void port() throws IOException {
  write("PORT "
      + controlSocket.getLocalAddress().getHostAddress().replace('.',
          ',') + ',' + (dataPort >> 8) + ','
      + (dataPort & 255)
      + "\r\n");
  if (getReply() != FTP_OK) {
    throw new IOException("Unable to configure data port");
  }
}
origin: robovm/robovm

/**
 * Issue the STOR command to the server with the file as the parameter
 */
private void sendFile() throws IOException {
  int reply;
  write("STOR "
      + url.getFile().substring(url.getFile().lastIndexOf('/') + 1,
          url.getFile().length()) + "\r\n");
  reply = getReply();
  if (!(reply == FTP_OPENDATA || reply == FTP_OK || reply == FTP_DATAOPEN)) {
    throw new IOException("Unable to store file");
  }
}
origin: robovm/robovm

private void login() throws IOException {
  int reply;
  reply = getReply();
  if (reply == FTP_USERREADY) {
  } else {
    throw new IOException("Unable to connect to server: " + url.getHost());
  }
  write("USER " + username + "\r\n");
  reply = getReply();
  if (reply == FTP_PASWD || reply == FTP_LOGGEDIN) {
  } else {
    throw new IOException("Unable to log in to server (USER): " + url.getHost());
  }
  if (reply == FTP_PASWD) {
    write("PASS " + password + "\r\n");
    reply = getReply();
    if (!(reply == FTP_OK || reply == FTP_USERREADY || reply == FTP_LOGGEDIN)) {
      throw new IOException("Unable to log in to server (PASS): " + url.getHost());
    }
  }
}
origin: robovm/robovm

/**
 * Change the server directory to that specified in the URL
 */
private void cd() throws IOException {
  int idx = url.getFile().lastIndexOf('/');
  if (idx > 0) {
    String dir = url.getFile().substring(0, idx);
    write("CWD " + dir + "\r\n");
    int reply = getReply();
    if (reply != FTP_FILEOK && dir.length() > 0 && dir.charAt(0) == '/') {
      write("CWD " + dir.substring(1) + "\r\n");
      reply = getReply();
    }
    if (reply != FTP_FILEOK) {
      throw new IOException("Unable to change directories");
    }
  }
}
origin: MobiVM/robovm

private void port() throws IOException {
  write("PORT "
      + controlSocket.getLocalAddress().getHostAddress().replace('.',
          ',') + ',' + (dataPort >> 8) + ','
      + (dataPort & 255)
      + "\r\n");
  if (getReply() != FTP_OK) {
    throw new IOException("Unable to configure data port");
  }
}
origin: MobiVM/robovm

/**
 * Set the type of the file transfer. Only Image is supported
 */
private void setType() throws IOException {
  write("TYPE I\r\n");
  if (getReply() != FTP_OK) {
    throw new IOException("Unable to set transfer type");
  }
}
origin: MobiVM/robovm

/**
 * Issue the STOR command to the server with the file as the parameter
 */
private void sendFile() throws IOException {
  int reply;
  write("STOR "
      + url.getFile().substring(url.getFile().lastIndexOf('/') + 1,
          url.getFile().length()) + "\r\n");
  reply = getReply();
  if (!(reply == FTP_OPENDATA || reply == FTP_OK || reply == FTP_DATAOPEN)) {
    throw new IOException("Unable to store file");
  }
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Set the type of the file transfer. Only Image is supported
 */
private void setType() throws IOException {
  write("TYPE I\r\n");
  if (getReply() != FTP_OK) {
    throw new IOException("Unable to set transfer type");
  }
}
origin: com.gluonhq/robovm-rt

private void port() throws IOException {
  write("PORT "
      + controlSocket.getLocalAddress().getHostAddress().replace('.',
          ',') + ',' + (dataPort >> 8) + ','
      + (dataPort & 255)
      + "\r\n");
  if (getReply() != FTP_OK) {
    throw new IOException("Unable to configure data port");
  }
}
origin: com.bugvm/bugvm-rt

/**
 * Issue the STOR command to the server with the file as the parameter
 */
private void sendFile() throws IOException {
  int reply;
  write("STOR "
      + url.getFile().substring(url.getFile().lastIndexOf('/') + 1,
          url.getFile().length()) + "\r\n");
  reply = getReply();
  if (!(reply == FTP_OPENDATA || reply == FTP_OK || reply == FTP_DATAOPEN)) {
    throw new IOException("Unable to store file");
  }
}
origin: MobiVM/robovm

private void getFile() throws IOException {
  int reply;
  String file = url.getFile();
  write("RETR " + file + "\r\n");
  reply = getReply();
  if (reply == FTP_NOTFOUND && file.length() > 0 && file.charAt(0) == '/') {
    write("RETR " + file.substring(1) + "\r\n");
    reply = getReply();
  }
  if (!(reply == FTP_OPENDATA || reply == FTP_TRANSFEROK)) {
    throw new FileNotFoundException("Unable to retrieve file: " + reply);
  }
}
origin: ibinti/bugvm

/**
 * Issue the STOR command to the server with the file as the parameter
 */
private void sendFile() throws IOException {
  int reply;
  write("STOR "
      + url.getFile().substring(url.getFile().lastIndexOf('/') + 1,
          url.getFile().length()) + "\r\n");
  reply = getReply();
  if (!(reply == FTP_OPENDATA || reply == FTP_OK || reply == FTP_DATAOPEN)) {
    throw new IOException("Unable to store file");
  }
}
origin: ibinti/bugvm

/**
 * Set the type of the file transfer. Only Image is supported
 */
private void setType() throws IOException {
  write("TYPE I\r\n");
  if (getReply() != FTP_OK) {
    throw new IOException("Unable to set transfer type");
  }
}
origin: ibinti/bugvm

private void port() throws IOException {
  write("PORT "
      + controlSocket.getLocalAddress().getHostAddress().replace('.',
          ',') + ',' + (dataPort >> 8) + ','
      + (dataPort & 255)
      + "\r\n");
  if (getReply() != FTP_OK) {
    throw new IOException("Unable to configure data port");
  }
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Issue the STOR command to the server with the file as the parameter
 */
private void sendFile() throws IOException {
  int reply;
  write("STOR "
      + url.getFile().substring(url.getFile().lastIndexOf('/') + 1,
          url.getFile().length()) + "\r\n");
  reply = getReply();
  if (!(reply == FTP_OPENDATA || reply == FTP_OK || reply == FTP_DATAOPEN)) {
    throw new IOException("Unable to store file");
  }
}
origin: com.bugvm/bugvm-rt

private void port() throws IOException {
  write("PORT "
      + controlSocket.getLocalAddress().getHostAddress().replace('.',
          ',') + ',' + (dataPort >> 8) + ','
      + (dataPort & 255)
      + "\r\n");
  if (getReply() != FTP_OK) {
    throw new IOException("Unable to configure data port");
  }
}
origin: com.bugvm/bugvm-rt

/**
 * Set the type of the file transfer. Only Image is supported
 */
private void setType() throws IOException {
  write("TYPE I\r\n");
  if (getReply() != FTP_OK) {
    throw new IOException("Unable to set transfer type");
  }
}
origin: com.bugvm/bugvm-rt

private void getFile() throws IOException {
  int reply;
  String file = url.getFile();
  write("RETR " + file + "\r\n");
  reply = getReply();
  if (reply == FTP_NOTFOUND && file.length() > 0 && file.charAt(0) == '/') {
    write("RETR " + file.substring(1) + "\r\n");
    reply = getReply();
  }
  if (!(reply == FTP_OPENDATA || reply == FTP_TRANSFEROK)) {
    throw new FileNotFoundException("Unable to retrieve file: " + reply);
  }
}
libcore.net.urlFtpURLConnectiongetReply

Popular methods of FtpURLConnection

  • <init>
    FtpURLConnection constructor.
  • cd
    Change the server directory to that specified in the URL
  • connect
    Establishes the connection to the resource specified by thisURL
  • connectInternal
  • getConnectTimeout
  • getDoInput
  • getFile
  • getReadTimeout
  • guessContentTypeFromName
  • login
  • port
  • readLine
    Read a line of text and return it for possible parsing
  • port,
  • readLine,
  • readMultiLine,
  • sendFile,
  • setType,
  • write

Popular in Java

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now