Tabnine Logo
FileURLConnection.getDirectoryListing
Code IndexAdd Tabnine to your IDE (free)

How to use
getDirectoryListing
method
in
libcore.net.url.FileURLConnection

Best Java code snippets using libcore.net.url.FileURLConnection.getDirectoryListing (Showing top 7 results out of 315)

origin: robovm/robovm

/**
 * This methods will attempt to obtain the input stream of the file pointed
 * by this <code>URL</code>. If the file is a directory, it will return
 * that directory listing as an input stream.
 *
 * @throws IOException
 *             if an IO error occurs while connecting
 */
@Override
public void connect() throws IOException {
  File f = new File(filename);
  if (f.isDirectory()) {
    isDir = true;
    is = getDirectoryListing(f);
    // use -1 for the contentLength
  } else {
    is = new BufferedInputStream(new FileInputStream(f));
    long lengthAsLong = f.length();
    length = lengthAsLong <= Integer.MAX_VALUE ? (int) lengthAsLong : Integer.MAX_VALUE;
  }
  connected = true;
}
origin: MobiVM/robovm

/**
 * This methods will attempt to obtain the input stream of the file pointed
 * by this <code>URL</code>. If the file is a directory, it will return
 * that directory listing as an input stream.
 *
 * @throws IOException
 *             if an IO error occurs while connecting
 */
@Override
public void connect() throws IOException {
  File f = new File(filename);
  if (f.isDirectory()) {
    isDir = true;
    is = getDirectoryListing(f);
    // use -1 for the contentLength
  } else {
    is = new BufferedInputStream(new FileInputStream(f));
    long lengthAsLong = f.length();
    length = lengthAsLong <= Integer.MAX_VALUE ? (int) lengthAsLong : Integer.MAX_VALUE;
  }
  connected = true;
}
origin: com.gluonhq/robovm-rt

/**
 * This methods will attempt to obtain the input stream of the file pointed
 * by this <code>URL</code>. If the file is a directory, it will return
 * that directory listing as an input stream.
 *
 * @throws IOException
 *             if an IO error occurs while connecting
 */
@Override
public void connect() throws IOException {
  File f = new File(filename);
  if (f.isDirectory()) {
    isDir = true;
    is = getDirectoryListing(f);
    // use -1 for the contentLength
  } else {
    is = new BufferedInputStream(new FileInputStream(f));
    long lengthAsLong = f.length();
    length = lengthAsLong <= Integer.MAX_VALUE ? (int) lengthAsLong : Integer.MAX_VALUE;
  }
  connected = true;
}
origin: ibinti/bugvm

/**
 * This methods will attempt to obtain the input stream of the file pointed
 * by this <code>URL</code>. If the file is a directory, it will return
 * that directory listing as an input stream.
 *
 * @throws IOException
 *             if an IO error occurs while connecting
 */
@Override
public void connect() throws IOException {
  File f = new File(filename);
  if (f.isDirectory()) {
    isDir = true;
    is = getDirectoryListing(f);
    // use -1 for the contentLength
  } else {
    is = new BufferedInputStream(new FileInputStream(f));
    long lengthAsLong = f.length();
    length = lengthAsLong <= Integer.MAX_VALUE ? (int) lengthAsLong : Integer.MAX_VALUE;
  }
  connected = true;
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * This methods will attempt to obtain the input stream of the file pointed
 * by this <code>URL</code>. If the file is a directory, it will return
 * that directory listing as an input stream.
 *
 * @throws IOException
 *             if an IO error occurs while connecting
 */
@Override
public void connect() throws IOException {
  File f = new File(filename);
  if (f.isDirectory()) {
    isDir = true;
    is = getDirectoryListing(f);
    // use -1 for the contentLength
  } else {
    is = new BufferedInputStream(new FileInputStream(f));
    long lengthAsLong = f.length();
    length = lengthAsLong <= Integer.MAX_VALUE ? (int) lengthAsLong : Integer.MAX_VALUE;
  }
  connected = true;
}
origin: FlexoVM/flexovm

/**
 * This methods will attempt to obtain the input stream of the file pointed
 * by this <code>URL</code>. If the file is a directory, it will return
 * that directory listing as an input stream.
 *
 * @throws IOException
 *             if an IO error occurs while connecting
 */
@Override
public void connect() throws IOException {
  File f = new File(filename);
  if (f.isDirectory()) {
    isDir = true;
    is = getDirectoryListing(f);
    // use -1 for the contentLength
  } else {
    is = new BufferedInputStream(new FileInputStream(f));
    long lengthAsLong = f.length();
    length = lengthAsLong <= Integer.MAX_VALUE ? (int) lengthAsLong : Integer.MAX_VALUE;
  }
  connected = true;
}
origin: com.bugvm/bugvm-rt

/**
 * This methods will attempt to obtain the input stream of the file pointed
 * by this <code>URL</code>. If the file is a directory, it will return
 * that directory listing as an input stream.
 *
 * @throws IOException
 *             if an IO error occurs while connecting
 */
@Override
public void connect() throws IOException {
  File f = new File(filename);
  if (f.isDirectory()) {
    isDir = true;
    is = getDirectoryListing(f);
    // use -1 for the contentLength
  } else {
    is = new BufferedInputStream(new FileInputStream(f));
    long lengthAsLong = f.length();
    length = lengthAsLong <= Integer.MAX_VALUE ? (int) lengthAsLong : Integer.MAX_VALUE;
  }
  connected = true;
}
libcore.net.urlFileURLConnectiongetDirectoryListing

Javadoc

Returns the directory listing of the file component as an input stream.

Popular methods of FileURLConnection

  • <init>
    Creates an instance of FileURLConnection for establishing a connection to the file pointed by this U
  • connect
    This methods will attempt to obtain the input stream of the file pointed by this URL. If the file i
  • guessContentTypeFromName
  • guessContentTypeFromStream

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • findViewById (Activity)
  • getSystemService (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Reference (javax.naming)
  • Best plugins for Eclipse
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