protected Archive openArchive(String uri) throws OpenFailureException { return CommonarchiveFactory.eINSTANCE.openApplicationClientFile(getArchiveOptions(), uri); }
protected Archive openArchive(String uri) throws OpenFailureException { Archive archive = CommonarchiveFactory.eINSTANCE.openEJBJarFile(getArchiveOptions(), uri); return archive; }
public ArchiveImpl() { super(); getCommonArchiveFactory().archiveOpened(this); }
protected ModuleRef createModuleRef(Module aModule, ModuleFile aFile) { ModuleRef newRef = null; if (aModule.isEjbModule()) newRef = getCommonArchiveFactory().createEJBModuleRef(); else if (aModule.isWebModule()) newRef = getCommonArchiveFactory().createWebModuleRef(); else if (aModule.isConnectorModule()) newRef = getCommonArchiveFactory().createConnectorModuleRef(); else if (aModule.isJavaModule()) newRef = getCommonArchiveFactory().createClientModuleRef(); newRef.setModule(aModule); newRef.setModuleFile(aFile); return newRef; }
protected LoadStrategy createLoadStrategyForReopen(Archive parent) throws IOException { LoadStrategy aLoadStrategy = null; LooseArchive loose = getLoadStrategy().getLooseArchive(); if (loose != null) { aLoadStrategy = getCommonArchiveFactory().createLoadStrategy(loose.getBinariesPath()); aLoadStrategy.setLooseArchive(loose); } else if (parent == null) aLoadStrategy = getCommonArchiveFactory().createLoadStrategy(getURI()); else aLoadStrategy = getCommonArchiveFactory().createChildLoadStrategy(getURI(), parent.getLoadStrategy()); return aLoadStrategy; }
protected Archive openNestedArchive(Module m, ArchiveOptions archiveOptions) throws OpenFailureException { String aUri = m.getUri(); try { /* * Since we have a clue about the type of archive to open Use the appropriate open * method, so if a failure occurrs, we can get a more specific message */ if (m.isWebModule()) return getCommonArchiveFactory().openWARFile(archiveOptions, aUri); else if (m.isEjbModule()) return getCommonArchiveFactory().openEJBJarFile(archiveOptions, aUri); else if (m.isJavaModule()) return getCommonArchiveFactory().openApplicationClientFile(archiveOptions, aUri); else if (m.isConnectorModule()) return getCommonArchiveFactory().openRARFile(archiveOptions, aUri); } catch (OpenFailureException ex) { throw new OpenFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.nested_open_fail_EXC_, (new Object[]{aUri, getURI()})), ex); // = "Unable to open module file "{0}" in EAR file "{1}"" } //Should never reach the code below return null; }
/** * Insert the method's description here. Creation date: (03/14/01 6:46:16 PM) * * @param args * java.lang.String[] */ public static void main(String[] args) { if (!validateArgs(args)) return; try { Archive anArchive = CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().primOpenArchive(args[0]); new RepairArchiveCommand(anArchive).execute(); anArchive.saveAs(args[1]); } catch (Exception ex) { System.out.println(CommonArchiveResourceHandler.Repair_command_failed___ex_EXC_); // = "Repair command failed - exception stack trace:" ex.printStackTrace(); } }
/** * @see com.ibm.etools.commonarchive.Archive */ public Archive addCopy(Archive anArchive) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException { checkAddValid(anArchive); Archive copy = getCommonArchiveFactory().copy(anArchive); getFiles().add(copy); return copy; }
public ApplicationClientFile createApplicationClientFile() { return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createApplicationClientFile(); }
public ClientModuleRef createClientModuleRef() { return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createClientModuleRef(); }
public ConnectorModuleRef createConnectorModuleRef() { return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createConnectorModuleRef(); }
protected ArchiveOptions getOptionsForOpening(String aUri) throws IOException { LoadStrategy strategy = getCommonArchiveFactory().createChildLoadStrategy(aUri, getLoadStrategy()); return getOptions().cloneWith(strategy, aUri); }
/** * @see com.ibm.etools.commonarchive.Archive */ public void close() { getLoadStrategy().close(); releaseClassLoader(); getCommonArchiveFactory().archiveClosed(this); if (isIndexed()) { List archives = getArchiveFiles(); for (int i = 0; i < archives.size(); i++) { ((Archive) archives.get(i)).close(); } } }
public static Archive asArchive(String jarUri, IProject project, boolean exportSource, boolean includeClasspathComponents) throws OpenFailureException { JavaComponentLoadStrategyImpl strat = new JavaComponentLoadStrategyImpl(ComponentCore.createComponent(project), includeClasspathComponents); strat.setExportSource(exportSource); return CommonarchiveFactoryImpl.getActiveFactory().primOpenArchive(strat, jarUri); }
protected File copy(File aFile) { File copy = null; if (aFile.isArchive()) copy = getCommonArchiveFactory().copy((Archive) aFile); else copy = (File) EtoolsCopyUtility.createCopy(aFile); return copy; }
public Archive createConvertedArchive() { return getArchiveFactory().createApplicationClientFile(); } }
public static Archive asArchiveFromBinary(String jarUri, IProject aProject) throws OpenFailureException { IPath path = getBinaryProjectJARLocation(aProject); if (path != null) { String location = path.toOSString(); Archive anArchive = CommonarchiveFactoryImpl.getActiveFactory().primOpenArchive(location); anArchive.setURI(jarUri); return anArchive; } return null; }
public Archive asArchive(boolean includeSource, boolean includeClasspathComponents) throws OpenFailureException{ if (isBinary()) { return ((EnterpriseBinaryComponentHelper) getBinaryComponentHelper()).accessArchive(); } else { AppClientComponentLoadStrategyImpl loader = new AppClientComponentLoadStrategyImpl(getComponent()); loader.setExportSource(includeSource); String uri = ModuleURIUtil.getHandleString(getComponent()); return CommonarchiveFactory.eINSTANCE.openApplicationClientFile(loader, uri); } }
public void createModuleFile() throws SaveFailureException { try { CommonarchiveFactory caf = ((CommonarchivePackage) EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI)).getCommonarchiveFactory(); EJBComponentLoadStrategyImpl ls = new EJBComponentLoadStrategyImpl(getComponent()); ls.setExportSource(isExportSource()); setModuleFile(caf.openEJBJarFile(ls, getDestinationPath().toOSString())); } catch (Exception e) { throw new SaveFailureException(EJBArchiveOpsResourceHandler.ARCHIVE_OPERATION_OpeningArchive, e); } }
protected Object primAddCopyRef(ModuleFile aModuleFile) throws DuplicateObjectException { //force this list to get initialized before the add EList refs = getModuleRefs(); if (aModuleFile.isEARFile()) //If it's an ear then just treat it like any other archive return super.addCopy(aModuleFile); checkAddValid(aModuleFile); ModuleFile copy = getCommonArchiveFactory().copy(aModuleFile); Module newModule = createModuleForCopying(aModuleFile); getFiles().add(copy); copy.initializeClassLoader(); if (!copy.getURI().equals(newModule.getUri())) copy.setURI(newModule.getUri()); getDeploymentDescriptor().getModules().add(newModule); ModuleRef aRef = createModuleRef(newModule, copy); refs.add(aRef); return aRef; }