/** * Converts the URL to a common local URL protocol (i.e file: or jar: protocol) * @return the local URL using a common local protocol */ public URL getLocalURL() { return bundleEntry.getLocalURL(); }
public byte[] getBytes() throws IOException { if (classbytes == null) { classbytes = wrapped.getBytes(); } return classbytes; }
/** * Converts the URL to a URL that uses the file: protocol. The content of this * URL may be downloaded or extracted onto the local filesystem to create a file URL. * @return the local URL that uses the file: protocol */ public URL getFileURL() { return bundleEntry.getFileURL(); } }
InputStream getDigestInputStream(BundleEntry nestedEntry) throws IOException { if (contentMDResults == null) return nestedEntry.getInputStream(); Object[] mdResult = (Object[]) contentMDResults.get(nestedEntry.getName()); if (mdResult == null) return null; try { return new DigestedInputStream(nestedEntry, content, (SignerInfo[]) mdResult[0], (byte[][]) mdResult[1], nestedEntry.getSize()); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } }
/** * Used for class loading. This default implementation gets the input stream from this entry * and copies the content into a byte array. * @return a byte array containing the content of this entry * @throws IOException */ public byte[] getBytes() throws IOException { InputStream in = getInputStream(); int length = (int) getSize(); // if (Debug.DEBUG_LOADER) // Debug.println(" about to read " + length + " bytes from " + getName()); //$NON-NLS-1$ //$NON-NLS-2$ return StorageUtil.getBytes(in, length, BUF_SIZE); } }
/** * Return the name of this BundleEntry by calling getName(). * * @return String representation of this BundleEntry. */ public String toString() { return (getName()); }
public long getLastModified() { long lastModified = bundleEntry.getTime(); if (lastModified == -1) { return (0); } return (lastModified); }
public long getSize() { return nestedEntry.getSize(); }
public InputStream getInputStream() throws IOException { // someone is trying to get the real bytes of the class file!! // just return the entry from the wrapped file instead of the magic cookie return wrapped.getInputStream(); }
InputStream getDigestInputStream(BundleEntry nestedEntry) throws IOException { if (contentMDResults == null) return nestedEntry.getInputStream(); Object[] mdResult = (Object[]) contentMDResults.get(nestedEntry.getName()); if (mdResult == null) return null; try { return new DigestedInputStream(nestedEntry, content, (SignerInfo[]) mdResult[0], (byte[][]) mdResult[1], nestedEntry.getSize()); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } }
/** * Used for class loading. This default implementation gets the input stream from this entry * and copies the content into a byte array. * @return a byte array containing the content of this entry * @throws IOException */ public byte[] getBytes() throws IOException { InputStream in = getInputStream(); int length = (int) getSize(); // if (Debug.DEBUG_LOADER) // Debug.println(" about to read " + length + " bytes from " + getName()); //$NON-NLS-1$ //$NON-NLS-2$ return StorageUtil.getBytes(in, length, BUF_SIZE); } }
/** * Return the name of this BundleEntry by calling getName(). * * @return String representation of this BundleEntry. */ public String toString() { return (getName()); }
public long getLastModified() { long lastModified = bundleEntry.getTime(); if (lastModified == -1) { return (0); } return (lastModified); }
public int getContentLength() { return ((int) bundleEntry.getSize()); }
public synchronized void connect() throws IOException { if (!connected) { if (bundleEntry != null) { in = bundleEntry.getInputStream(); connected = true; } else { throw new IOException(NLS.bind(Msg.RESOURCE_NOT_FOUND_EXCEPTION, url)); } } }
InputStream getDigestInputStream(BundleEntry nestedEntry) throws IOException { if (contentMDResults == null) return nestedEntry.getInputStream(); Object[] mdResult = (Object[]) contentMDResults.get(nestedEntry.getName()); if (mdResult == null) return null; try { return new DigestedInputStream(nestedEntry, content, (SignerInfo[]) mdResult[0], (byte[][]) mdResult[1], nestedEntry.getSize()); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } }
/** * Used for class loading. This default implementation gets the input stream from this entry * and copies the content into a byte array. * @return a byte array containing the content of this entry * @throws IOException */ public byte[] getBytes() throws IOException { InputStream in = getInputStream(); int length = (int) getSize(); // if (Debug.DEBUG_LOADER) // Debug.println(" about to read " + length + " bytes from " + getName()); //$NON-NLS-1$ //$NON-NLS-2$ return StorageUtil.getBytes(in, length, BUF_SIZE); } }
/** * Converts the URL to a common local URL protocol (i.e file: or jar: protocol) * @return the local URL using a common local protocol */ public URL getLocalURL() { return bundleEntry.getLocalURL(); }
/** * Return the name of this BundleEntry by calling getName(). * * @return String representation of this BundleEntry. */ public String toString() { return (getName()); }
public void verify() throws IOException, InvalidContentException { BundleFile currentContent = content; if (currentContent == null) throw new InvalidContentException("The content was not set", null); //$NON-NLS-1$ BundleEntry entry = null; SecurityException exception = null; try { entry = currentContent.getEntry(entryName); } catch (SecurityException e) { exception = e; } if (entry == null) throw new InvalidContentException(NLS.bind(SignedContentMessages.file_is_removed_from_jar, entryName, currentContent.getBaseFile().toString()), exception); entry.getBytes(); } }