public JarEntryResource clone(Object newParent) { JarEntryFile file = new JarEntryFile(this.simpleName); file.setParent(newParent); return file; }
@Override public String toString() { return "JarEntryFile["+getEntryName()+"]"; //$NON-NLS-2$ //$NON-NLS-1$ } }
public InputStream getContents() throws CoreException { ZipFile zipFile = null; try { zipFile = getZipFile(); if (JavaModelManager.ZIP_ACCESS_VERBOSE) { System.out.println("(" + Thread.currentThread() + ") [JarEntryFile.getContents()] Creating ZipFile on " +zipFile.getName()); //$NON-NLS-1$ //$NON-NLS-2$ } String entryName = getEntryName(); ZipEntry zipEntry = zipFile.getEntry(entryName); if (zipEntry == null){ throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryName)); } byte[] contents = Util.getZipEntryByteContent(zipEntry, zipFile); return new ByteArrayInputStream(contents); } catch (IOException e){ throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION); } finally { // avoid leaking ZipFiles JavaModelManager.getJavaModelManager().closeZipFile(zipFile); } }
@Override public InputStream getContents() throws CoreException { IPackageFragmentRoot root = getPackageFragmentRoot(); if (Util.isJrt(root.getPath().toOSString())) { try { Object target = JavaModel.getTarget(rootPath, false); if (target != null && target instanceof File) { return JRTUtil.getContentFromJrt((File) target, getEntryName(), root.getElementName()); ZipFile zipFile = null; try { zipFile = getZipFile(); if (JavaModelManager.ZIP_ACCESS_VERBOSE) { System.out.println("(" + Thread.currentThread() + ") [JarEntryFile.getContents()] Creating ZipFile on " +zipFile.getName()); //$NON-NLS-1$ //$NON-NLS-2$ String entryName = getEntryName(); ZipEntry zipEntry = zipFile.getEntry(entryName); if (zipEntry == null){
if (o instanceof JarEntryFile) { JarEntryFile f = (JarEntryFile) o; String fileName = f.getName(); if (resourceMatchesPrefix(fileName, fileNamePrefix)) { try (InputStream is = f.getContents()) { translationFiles.add(new PlatformTranslationFile(is, getLanguage(fileName)));
public InputStream getContents() throws CoreException { ZipFile zipFile = null; try { zipFile = getZipFile(); if (JavaModelManager.ZIP_ACCESS_VERBOSE) { System.out.println("(" + Thread.currentThread() + ") [JarEntryFile.getContents()] Creating ZipFile on " +zipFile.getName()); //$NON-NLS-1$ //$NON-NLS-2$ } String entryName = getEntryName(); ZipEntry zipEntry = zipFile.getEntry(entryName); if (zipEntry == null){ throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryName)); } byte[] contents = Util.getZipEntryByteContent(zipEntry, zipFile); return new ByteArrayInputStream(contents); } catch (IOException e){ throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION); } finally { // avoid leaking ZipFiles JavaModelManager.getJavaModelManager().closeZipFile(zipFile); } }
public InputStream getContents() throws CoreException { IPackageFragmentRoot root = getPackageFragmentRoot(); if (Util.isJrt(root.getPath().toOSString())) { try { Object target = JavaModel.getTarget(rootPath, false); if (target != null && target instanceof File) { return JRTUtil.getContentFromJrt((File) target, getEntryName(), root.getElementName()); ZipFile zipFile = null; try { zipFile = getZipFile(); if (JavaModelManager.ZIP_ACCESS_VERBOSE) { System.out.println("(" + Thread.currentThread() + ") [JarEntryFile.getContents()] Creating ZipFile on " +zipFile.getName()); //$NON-NLS-1$ //$NON-NLS-2$ String entryName = getEntryName(); ZipEntry zipEntry = zipFile.getEntry(entryName); if (zipEntry == null){
public JarEntryResource clone(Object newParent) { JarEntryFile file = new JarEntryFile(this.simpleName); file.setParent(newParent); return file; }
public InputStream getContents() throws CoreException { ZipFile zipFile = null; try { zipFile = getZipFile(); if (JavaModelManager.ZIP_ACCESS_VERBOSE) { System.out.println("(" + Thread.currentThread() + ") [JarEntryFile.getContents()] Creating ZipFile on " +zipFile.getName()); //$NON-NLS-1$ //$NON-NLS-2$ } String entryName = getEntryName(); ZipEntry zipEntry = zipFile.getEntry(entryName); if (zipEntry == null){ throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryName)); } byte[] contents = Util.getZipEntryByteContent(zipEntry, zipFile); return new ByteArrayInputStream(contents); } catch (IOException e){ throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION); } finally { // avoid leaking ZipFiles JavaModelManager.getJavaModelManager().closeZipFile(zipFile); } }
public String toString() { return "JarEntryFile["+getEntryName()+"]"; //$NON-NLS-2$ //$NON-NLS-1$ } }
@Override public JarEntryResource clone(Object newParent) { JarEntryFile file = new JarEntryFile(this.simpleName); file.setParent(newParent); return file; }
public InputStream getContents() throws CoreException { ZipFile zipFile = null; try { zipFile = getZipFile(); if (JavaModelManager.ZIP_ACCESS_VERBOSE) { System.out.println("(" + Thread.currentThread() + ") [JarEntryFile.getContents()] Creating ZipFile on " +zipFile.getName()); //$NON-NLS-1$ //$NON-NLS-2$ } String entryName = getEntryName(); ZipEntry zipEntry = zipFile.getEntry(entryName); if (zipEntry == null){ throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryName)); } byte[] contents = Util.getZipEntryByteContent(zipEntry, zipFile); return new ByteArrayInputStream(contents); } catch (IOException e){ throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION); } finally { // avoid leaking ZipFiles JavaModelManager.getJavaModelManager().closeZipFile(zipFile); } }
public String toString() { return "JarEntryFile["+getEntryName()+"]"; //$NON-NLS-2$ //$NON-NLS-1$ } }
public JarEntryResource clone(Object newParent) { JarEntryFile file = new JarEntryFile(this.simpleName); file.setParent(newParent); return file; }
public String toString() { return "JarEntryFile["+getEntryName()+"]"; //$NON-NLS-2$ //$NON-NLS-1$ } }
public JarEntryResource clone(Object newParent) { JarEntryFile file = new JarEntryFile(this.simpleName); file.setParent(newParent); return file; }
public String toString() { return "JarEntryFile["+getEntryName()+"]"; //$NON-NLS-2$ //$NON-NLS-1$ } }
public JarEntryResource clone(Object newParent) { JarEntryFile file = new JarEntryFile(this.simpleName); file.setParent(newParent); return file; }
public String toString() { return "JarEntryFile["+getEntryName()+"]"; //$NON-NLS-2$ //$NON-NLS-1$ } }
JarEntryFile file = new JarEntryFile(filePath.lastSegment()); jarEntries.put(childPath, file); if (childPath.segmentCount() == 1) { file.setParent(this); topJarEntries.add(file); } else {