List of usage examples for org.springframework.boot.loader.archive ExplodedArchive ExplodedArchive
public ExplodedArchive(File root)
From source file:org.springframework.cloud.dataflow.server.service.impl.validation.DefaultValidationService.java
private static Archive resolveAsArchive(Resource app) throws IOException { Assert.notNull(app, "The resource specified for the app must not be null"); File moduleFile = app.getFile(); return moduleFile.isDirectory() ? new ExplodedArchive(moduleFile) : new JarFileArchive(moduleFile); }
From source file:org.springframework.cloud.deployer.thin.ThinJarAppWrapper.java
protected final Archive createArchive() { try {/*from w w w.j a va 2 s . co m*/ ProtectionDomain protectionDomain = getClass().getProtectionDomain(); CodeSource codeSource = protectionDomain.getCodeSource(); URI location; location = (codeSource == null ? null : codeSource.getLocation().toURI()); String path = (location == null ? null : location.getSchemeSpecificPart()); if (path == null) { throw new IllegalStateException("Unable to determine code source archive"); } File root = new File(path); if (!root.exists()) { throw new IllegalStateException("Unable to determine code source archive from " + root); } return (root.isDirectory() ? new ExplodedArchive(root) : new JarFileArchive(root)); } catch (Exception e) { throw new IllegalStateException("Cannt create local archive", e); } }