Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileSelector


 
  public File getResourceAsFile(String path) throws IOException {
    FileObject unpackedResource = _work.resolveFile(path);
    if (!unpackedResource.exists()) {
      FileObject sourceFile = _source.resolveFile(path);
      sourceFile.copyFrom(unpackedResource, new FileSelector() {

        public boolean includeFile(FileSelectInfo arg0) throws Exception {
          return true;
        }
View Full Code Here


 
  public void copy(String sourcePath, File targetDir) throws IOException {
    FileObject target = VFS.getManager().resolveFile(targetDir.getAbsolutePath());
    FileObject source = _source.resolveFile(sourcePath);
    if (source.exists()) {
      target.copyFrom(source, new FileSelector() {

        public boolean includeFile(FileSelectInfo arg0) throws Exception {
          return true;
        }
View Full Code Here

          {
            depth++;
            value = value.substring(i + 2);
          }
        final int fdepth = depth;
        FileSelector fs = new FileSelector()
        {
          public boolean includeFile(FileSelectInfo info) throws Exception
          {
            // files /x/x causes exceptions -> these are imaginary
            // files -> ignore
View Full Code Here

    private FileObject getDeploymentScript(FileObject applicationFolder) throws FileSystemException {
        final FileObject metaInf = applicationFolder.getChild("META-INF");
        if(metaInf == null) {
            throw new FileSystemException("Missing META-INF folder in " + applicationFolder.getName().getPath());
        }
        final FileObject[] nanocontainerScripts = metaInf.findFiles(new FileSelector(){

            public boolean includeFile(FileSelectInfo fileSelectInfo) throws Exception {
                return fileSelectInfo.getFile().getName().getBaseName().startsWith(getFileBasename());
            }
View Full Code Here

        if (!resourcePath.startsWith(basePath)) {
          throw new WGAServiceException(new IllegalArgumentException("Illegal design resource path '" + path + "'."));
        }
       
        if (resource.exists()) {
          resource.delete(new FileSelector() {

            public boolean includeFile(FileSelectInfo fileInfo) throws Exception {
              return true;
            }
View Full Code Here

        try {
            fsManager = VFS.getManager();
            String absolutePath = resolveArchiveURI(archiveFile);
            FileObject resolvedFile = fsManager.resolveFile(absolutePath);

            FileSelector fileSelector = new FileSelector() {
                /**
                 * @see org.apache.commons.vfs.FileSelector#traverseDescendents(org.apache.commons.vfs.FileSelectInfo)
                 */
                public boolean traverseDescendents(FileSelectInfo folderInfo) throws Exception {
                    return true;
View Full Code Here

            source = manager.createFileSystem(source);
        }
        FileObject target = manager.createVirtualFileSystem(manager.resolveFile(targetFolder
                .getAbsolutePath()));

        FileSelector selector = new AllFileSelector() {
            @Override
            public boolean includeFile(FileSelectInfo fileInfo) {
                LOGGER.fine("Uncompressing " + fileInfo.getFile().getName().getFriendlyURI());
                return true;
            }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs.FileSelector

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.