@Override public boolean exists(String name) throws IOException { for (ReadableArchive ra : archives) { if (ra.exists(name)) { return true; } } return false; }
@Override public boolean exists() { boolean result = true; for (ReadableArchive ra : archives) { result &= ra.exists(); } return result; }
private boolean isJar(ReadableArchive location) { // check for ejb-jar.xml boolean result = false; try { result = location.exists("META-INF/ejb-jar.xml"); } catch (IOException ioEx) { //TODO } return result; }
private boolean isEntryPresent(ReadableArchive location, String entry) { boolean entryPresent = false; try { entryPresent = location.exists(entry); } catch (IOException e) { // ignore } return entryPresent; }
private boolean isJar(ReadableArchive location) { // check for ejb-jar.xml boolean result = false; try { result = location.exists("META-INF/ejb-jar.xml"); } catch (IOException ioEx) { //TODO } return result; }
private boolean isEntryPresent(ReadableArchive location, String entry) { boolean entryPresent = false; try { entryPresent = location.exists(entry); } catch (IOException e) { // ignore } return entryPresent; }
public boolean exists() { return delegate.exists(); }
/** * Returns true if the passed file or directory is recognized by this * instance. * * @param location the file or directory to explore * @param loader class loader for this application * @return true if this sniffer handles this application type */ public boolean handles(ReadableArchive location, ClassLoader loader) { if (appStigma != null) { try { if (location.exists(appStigma)) { return true; } } catch (IOException e) { // ignore } } return false; }
/** * Returns true if the passed file or directory is recognized by this * instance. * * @param location the file or directory to explore * @return true if this sniffer handles this application type */ public boolean handles(ReadableArchive location) { if (appStigma != null) { try { if (location.exists(appStigma)) { return true; } } catch (IOException e) { // ignore } } return false; }
public boolean exists(String name) throws IOException { if (filter.accept(delegate, name)) { return delegate.exists(name); } return false; }
@Override public boolean handles(ReadableArchive archive) { try { if (archive.exists(EJB_JAR_XML) || archive.exists(SUN_EJB_JAR_XML) || archive.exists(GF_EJB_JAR_XML)) { return true; } GenericAnnotationDetector detector = new GenericAnnotationDetector(sniffer.getAnnotationTypes()); return detector.hasAnnotationInArchive(archive); }catch(IOException ioe){ //ignore } return false; }
@Override public boolean handles(ReadableArchive archive) throws IOException { boolean isEar = false; try{ if (Util.getURIName(archive.getURI()).endsWith(EAR_EXTENSION)) { return true; } isEar = archive.exists(APPLICATION_XML) || archive.exists(SUN_APPLICATION_XML) || archive.exists(GF_APPLICATION_XML); if (!isEar) { isEar = isEARFromIntrospecting(archive); } }catch(IOException ioe){ //ignore } return isEar; }
/** * check whether the archive is a .rar * @param archive archive to be tested * @return status of .rar or not */ public static boolean isRAR(ReadableArchive archive){ boolean isRar = false; try{ if (Util.getURIName(archive.getURI()).endsWith(RAR_EXTENSION)) { return true; } isRar = archive.exists(RA_XML); }catch(IOException ioe){ //ignore } return isRar; }
public static List<ConfigurationDeploymentDescriptorFile> processConfigurationDDFiles(List<ConfigurationDeploymentDescriptorFile> ddFiles, ReadableArchive archive, ArchiveType archiveType) throws IOException { File runtimeAltDDFile = archive.getArchiveMetaData( DeploymentProperties.RUNTIME_ALT_DD, File.class); if (runtimeAltDDFile != null && runtimeAltDDFile.exists() && runtimeAltDDFile.isFile()) { // if there are external runtime alternate deployment descriptor // specified, the config DD files are already processed return sortConfigurationDDFiles(ddFiles, archiveType, archive); } List<ConfigurationDeploymentDescriptorFile> processedConfDDFiles = new ArrayList<ConfigurationDeploymentDescriptorFile>(); for (ConfigurationDeploymentDescriptorFile ddFile : sortConfigurationDDFiles(ddFiles, archiveType, archive)) { if (archive.exists(ddFile.getDeploymentDescriptorPath())) { processedConfDDFiles.add(ddFile); } } return processedConfDDFiles; }
public static boolean isWebArchive(ReadableArchive archive) { try { if (Util.getURIName(archive.getURI()).endsWith(WAR_EXTENSION)) { return true; } if (archive.exists(WEB_INF)) { return true; } Enumeration<String> entries = archive.entries(); while (entries.hasMoreElements()) { String entryName = entries.nextElement(); if (entryName.endsWith(JSP_SUFFIX)) { return true; } } return false; } catch (IOException ioe) { // ignore } return false; }
@Override public Object readRuntimeDeploymentDescriptor(Archivist main, ReadableArchive archive, RootDeploymentDescriptor descriptor) throws IOException, SAXParseException { DeploymentDescriptorFile configDD = getConfigurationDDFile(descriptor); String configDDPath = configDD.getDeploymentDescriptorPath(); if (archive.exists(configDDPath)) { DOLUtils.getDefaultLogger().warning( localStrings.getLocalString("enterprise.deployment.archivist.DDNotSupported", "Ignore {0} as it is not supported in this release.", new Object[]{configDDPath})); } return descriptor; } }
WebXmlParser(ReadableArchive archive) throws XMLStreamException, IOException { if (archive.exists(getXmlFileName())) { try (InputStream is = archive.getEntry(getXmlFileName())) { init(is); } catch (Throwable t) { String msg = localStrings.getLocalString("web.deployment.exception_parsing_webxml", "Error in parsing {0} for archive [{1}]: {2}", getXmlFileName(), archive.getURI(), t.getMessage()); throw new RuntimeException(msg); } } }
/** * If WEB-INF/sun-jaxws.xml exists and is not processed in EJB context , then it returns true. * @param annInfo * @return */ private boolean isJaxwsRIDeployment(AnnotationInfo annInfo) { boolean riDeployment = false; AnnotatedElementHandler annCtx = annInfo.getProcessingContext().getHandler(); try { ReadableArchive moduleArchive = annInfo.getProcessingContext().getArchive(); if (moduleArchive != null && moduleArchive.exists("WEB-INF/sun-jaxws.xml") && !((Class)annInfo.getAnnotatedElement()).isInterface() && ( (annCtx instanceof WebBundleContext) || (annCtx instanceof WebComponentContext))) { riDeployment = true; } } catch (Exception e) { //continue, processing } return riDeployment; }
/** * If WEB-INF/sun-jaxws.xml exists and is not processed in EJB context , then it returns true. * @param annInfo * @return */ private boolean isJaxwsRIDeployment(AnnotationInfo annInfo) { boolean riDeployment = false; AnnotatedElementHandler annCtx = annInfo.getProcessingContext().getHandler(); try { ReadableArchive moduleArchive = annInfo.getProcessingContext().getArchive(); if (moduleArchive != null && moduleArchive.exists("WEB-INF/sun-jaxws.xml") && !((Class)annInfo.getAnnotatedElement()).isInterface() && ( (annCtx instanceof WebBundleContext) || (annCtx instanceof WebComponentContext))) { riDeployment = true; } } catch (Exception e) { //continue, processing } return riDeployment; }
/** * If WEB-INF/sun-jaxws.xml exists and is not processed in EJB context , then it returns true. * @param annInfo * @return */ private boolean isJaxwsRIDeployment(AnnotationInfo annInfo) { boolean riDeployment = false; AnnotatedElementHandler annCtx = annInfo.getProcessingContext().getHandler(); try { ReadableArchive moduleArchive = annInfo.getProcessingContext().getArchive(); if (moduleArchive != null && moduleArchive.exists("WEB-INF/sun-jaxws.xml") && !((Class)annInfo.getAnnotatedElement()).isInterface() && ( (annCtx instanceof WebBundleContext) || (annCtx instanceof WebComponentContext))) { riDeployment = true; } } catch (Exception e) { //continue, processing } return riDeployment; }