Package net.sourceforge.javautil.common.io.impl

Examples of net.sourceforge.javautil.common.io.impl.ZippedDirectory


     
      if ( urlPath.startsWith("file:") ) urlPath = urlPath.substring(5);
      if ( urlPath.indexOf('!')>0 ) urlPath = urlPath.substring(0, urlPath.indexOf('!'));
     
      File file = new File(urlPath);
      return file.isDirectory() ? new SystemDirectory(file) : new ZippedDirectory(new SystemFile(file));
    } catch (UnsupportedEncodingException e) {
      throw ThrowableManagerRegistry.caught(e);
    }
  }
View Full Code Here


public class WebApplicationDeploymentPatternWAR implements IVirtualArtifactDeploymentPattern<IVirtualDirectory,WebApplicationDeployment<IVirtualDirectory>,WebApplicationDeployer> {
 
  public WebApplicationDeployment<IVirtualDirectory> createDeployment(WebApplicationDeployer deployer, IVirtualArtifact artifact) {
    IVirtualDirectory war = null;
    if (artifact instanceof SystemFile && "war".equals( ((IVirtualFile)artifact).getExtension() )) {
      war = new ZippedDirectory( (SystemFile) artifact );
    } else if (artifact instanceof IVirtualDirectory && artifact.getName().endsWith(".war")) {
      war = (IVirtualDirectory) artifact;
    } else {
      throw new VirtualArtifactDeployerException(deployer, artifact, "Cannot deploy the artifact as a web application: " + artifact);
    }
View Full Code Here

    IVirtualArtifact va = VirtualArtifactSystem.getArtifactFor(url);
    if (va == null) {
      if (url.getProtocol().equals("jar")) {
        String path = url.getPath();
        if (path.startsWith("file://")) path = path.substring(7);
        va = new ZippedDirectory(new SystemFile(path));
      } else if (url.getProtocol().equals("file")) {
        String path = url.getPath();
        File target = new File(path);
        if (target.isDirectory()) {
          va = new SystemDirectory(target);
        } else {
          if (ArchiveUtil.isArchive(target)) {
            va = new ZippedDirectory(new SystemFile(target));
          }
        }
      }
    } else {
      if (va instanceof VirtualArtifactWrapped) {
        va = ((VirtualArtifactWrapped)va).unwrap(ISystemArtifact.class);
        if (va instanceof SystemFile && ArchiveUtil.isArchive( (SystemFile) va )) {
          va = new ZippedDirectory( (SystemFile) va );
        }
      }
    }
   
    if (!(va instanceof IVirtualDirectory)) return null;
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.common.io.impl.ZippedDirectory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.