/** * Returns the Jar file referred by this {@code URLConnection}. * * @throws IOException * thrown if an IO error occurs while connecting to the * resource. */ @Override public JarFile getJarFile() throws IOException { connect(); return jarFile; }
/** * Returns the JarEntry of the entry referenced by this {@code * URLConnection}. * * @return the JarEntry referenced * * @throws IOException * if an IO error occurs while getting the entry */ @Override public JarEntry getJarEntry() throws IOException { connect(); return jarEntry; }
/** * Creates an input stream for reading from this URL Connection. * * @return the input stream * * @throws IOException * if an IO error occurs while connecting to the resource. */ @Override public InputStream getInputStream() throws IOException { if (closed) { throw new IllegalStateException("JarURLConnection InputStream has been closed"); } connect(); if (jarInput != null) { return jarInput; } if (jarEntry == null) { throw new IOException("Jar entry not specified"); } return jarInput = new JarURLConnectionInputStream(jarFile .getInputStream(jarEntry), jarFile); }
/** * Returns the object pointed by this {@code URL}. If this URLConnection is * pointing to a Jar File (no Jar Entry), this method will return a {@code * JarFile} If there is a Jar Entry, it will return the object corresponding * to the Jar entry content type. * * @return a non-null object * * @throws IOException * if an IO error occurred * * @see ContentHandler * @see ContentHandlerFactory * @see java.io.IOException * @see #setContentHandlerFactory(ContentHandlerFactory) */ @Override public Object getContent() throws IOException { connect(); // if there is no Jar Entry, return a JarFile if (jarEntry == null) { return jarFile; } return super.getContent(); }
/** * Returns the content length of the resource. Test cases reveal that if the * URL is referring to a Jar file, this method answers a content-length * returned by URLConnection. For jar entry it should return it's size. * Otherwise, it will return -1. * * @return the content length */ @Override public int getContentLength() { try { connect(); if (jarEntry == null) { return jarFileURLConnection.getContentLength(); } return (int) getJarEntry().getSize(); } catch (IOException e) { // Ignored } return -1; }
} else { try { connect(); cType = jarFileURLConnection.getContentType(); } catch (IOException ioe) {
/** * Returns the Jar file referred by this {@code URLConnection}. * * @throws IOException * thrown if an IO error occurs while connecting to the * resource. */ @Override public JarFile getJarFile() throws IOException { connect(); return jarFile; }
/** * Returns the Jar file referred by this {@code URLConnection}. * * @throws IOException * thrown if an IO error occurs while connecting to the * resource. */ @Override public JarFile getJarFile() throws IOException { connect(); return jarFile; }
/** * Returns the Jar file referred by this {@code URLConnection}. * * @throws IOException * thrown if an IO error occurs while connecting to the * resource. */ @Override public JarFile getJarFile() throws IOException { connect(); return jarFile; }
/** * Returns the Jar file referred by this {@code URLConnection}. * * @throws IOException * thrown if an IO error occurs while connecting to the * resource. */ @Override public JarFile getJarFile() throws IOException { connect(); return jarFile; }
/** * Returns the Jar file referred by this {@code URLConnection}. * * @throws IOException * thrown if an IO error occurs while connecting to the * resource. */ @Override public JarFile getJarFile() throws IOException { connect(); return jarFile; }
/** * Returns the Jar file referred by this {@code URLConnection}. * * @throws IOException * thrown if an IO error occurs while connecting to the * resource. */ @Override public JarFile getJarFile() throws IOException { connect(); return jarFile; }
/** * Returns the JarEntry of the entry referenced by this {@code * URLConnection}. * * @return the JarEntry referenced * * @throws IOException * if an IO error occurs while getting the entry */ @Override public JarEntry getJarEntry() throws IOException { connect(); return jarEntry; }
/** * Returns the JarEntry of the entry referenced by this {@code * URLConnection}. * * @return the JarEntry referenced * * @throws IOException * if an IO error occurs while getting the entry */ @Override public JarEntry getJarEntry() throws IOException { connect(); return jarEntry; }
/** * Returns the JarEntry of the entry referenced by this {@code * URLConnection}. * * @return the JarEntry referenced * * @throws IOException * if an IO error occurs while getting the entry */ @Override public JarEntry getJarEntry() throws IOException { connect(); return jarEntry; }
/** * Returns the JarEntry of the entry referenced by this {@code * URLConnection}. * * @return the JarEntry referenced * * @throws IOException * if an IO error occurs while getting the entry */ @Override public JarEntry getJarEntry() throws IOException { connect(); return jarEntry; }
/** * Returns the JarEntry of the entry referenced by this {@code * URLConnection}. * * @return the JarEntry referenced * * @throws IOException * if an IO error occurs while getting the entry */ @Override public JarEntry getJarEntry() throws IOException { connect(); return jarEntry; }
/** * Returns the JarEntry of the entry referenced by this {@code * URLConnection}. * * @return the JarEntry referenced * * @throws IOException * if an IO error occurs while getting the entry */ @Override public JarEntry getJarEntry() throws IOException { connect(); return jarEntry; }
/** * Returns the content length of the resource. Test cases reveal that if the * URL is referring to a Jar file, this method answers a content-length * returned by URLConnection. For jar entry it should return it's size. * Otherwise, it will return -1. * * @return the content length */ @Override public int getContentLength() { try { connect(); if (jarEntry == null) { return jarFileURLConnection.getContentLength(); } return (int) getJarEntry().getSize(); } catch (IOException e) { // Ignored } return -1; }
/** * Returns the content length of the resource. Test cases reveal that if the * URL is referring to a Jar file, this method answers a content-length * returned by URLConnection. For jar entry it should return it's size. * Otherwise, it will return -1. * * @return the content length */ @Override public int getContentLength() { try { connect(); if (jarEntry == null) { return jarFileURLConnection.getContentLength(); } return (int) getJarEntry().getSize(); } catch (IOException e) { // Ignored } return -1; }