Codota Logo
FtpURLConnection.write
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
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

/**
 * 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: 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: 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

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

/**
 * 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

/**
 * 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 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

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.urlFtpURLConnectionwrite

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
  • getReply
  • guessContentTypeFromName
  • login
  • port
  • login,
  • port,
  • readLine,
  • readMultiLine,
  • sendFile,
  • setType

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • BoxLayout (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now