Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileObject.findFiles()


        if (prefix != null)
          nbase = basef.resolveFile(prefix);
        else
          nbase = basef;

        FileObject[] files = nbase.findFiles(fs);
        if (files != null && files.length > 0)
          return Arrays.asList(files);
        else
          return new ArrayList();
      }
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

                fileSystem = fsManager.createFileSystem(resolvedFile);
            } else {
                fileSystem = resolvedFile;
            }
            LOGGER.fine("Listing spatial data files archived in " + archiveFile.getName());
            FileObject[] containedFiles = fileSystem.findFiles(fileSelector);
            List<String> names = new ArrayList<String>(containedFiles.length);
            for (FileObject fo : containedFiles) {
                // path relative to its filesystem (ie, to the archive file)
                String pathDecoded = fo.getName().getPathDecoded();
                names.add(pathDecoded);
View Full Code Here

    }

    public void ls (String path) {
        try {
            FileObject file = fsManager.resolveFile(path);
            FileObject[] files = file.findFiles(Selectors.EXCLUDE_SELF);

            if (files.length > 0) {
                SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                for (FileObject _file : files) {
                    String lastModDate = df.format(new Date(_file.getContent().getLastModifiedTime()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.