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