Package java.io

Examples of java.io.File.list()


                // therefore we have permission to freak out
                throw new RuntimeException(ioe.toString());
            }
            File lib = new File(webappBase, "/WEB-INF/lib");
            if (lib.exists() && lib.isDirectory()) {
                String[] libs = lib.list();
                for (int i = 0; i < libs.length; i++) {
                    if( libs[i].length() <5 ) continue;
                    String ext=libs[i].substring( libs[i].length() - 4 );
                    if (! ".jar".equalsIgnoreCase(ext)) {
                        if (".tld".equalsIgnoreCase(ext)) {
View Full Code Here


        while (!dirs.isEmpty()) {
            String s = dirs.pop();
            File f = new File(s);
            if (f.exists() && f.isDirectory()) {
                String[] files = f.list();
                String ext;
                for (int i = 0; (files != null) && i < files.length; i++) {
                    File f2 = new File(s, files[i]);
                    if (f2.isDirectory()) {
                        dirs.push(f2.getPath());
View Full Code Here

                // therefore we have permission to freak out
                throw new RuntimeException(ioe.toString());
            }
            File lib = new File(webappBase, "/WEB-INF/lib");
            if (lib.exists() && lib.isDirectory()) {
                String[] libs = lib.list();
                for (int i = 0; i < libs.length; i++) {
                    if( libs[i].length() <5 ) continue;
                    String ext=libs[i].substring( libs[i].length() - 4 );
                    if (! ".jar".equalsIgnoreCase(ext)) {
                        if (".tld".equalsIgnoreCase(ext)) {
View Full Code Here

    if(styles != null)
      return styles;
    StringBuffer path = new StringBuffer(baseStylePath);
    path.append(name);
    File fPath = new File(path.toString());
    String[] css_files = fPath.list(new FilenameFilter() {
      public boolean accept(File dir, String name) {
        return name.endsWith(".css") && !name.startsWith("_");
      }
    });
    styles = new ArrayList();
View Full Code Here

 
  @NotBound
  public String[] getTomcatLibraryNames() {
    File dir = _wgaRuntime.getCatalinaLibDir().getLocation().toFile();
    String[] names;   
    names = dir.list(new FilenameFilter() {

      public boolean accept(File dir, String name) {
          return name.endsWith(".jar");
      }
     
View Full Code Here

        if (f.isFile() && path.endsWith(".java")) {
            if (!isExcluded(path)) {
                files.add(path);
            }
        } else if (f.isDirectory() && recurse > 0) {
            for (String name : f.list()) {
                addDir(path + "/" + name, recurse - 1);
            }
        }
    }
View Full Code Here

                    if (basedir == null) {
                        System.err.println("File name pattern argument not allowed for non-file base: '" + name + '\'');
                    } else {
                        filter.setPattern(name);
                        s_logger.debug("Matching file names to command line pattern '" + name + '\'');
                        String[] matches = basedir.list(filter);
                        for (int i = 0; i < matches.length; i++) {
                            String match = matches[i];
                            fileset.add(new UrlResolver(match, new URL(base, match)));
                        }
                    }
View Full Code Here

    public String[] listFiles(String path) {
        path = translateFileName(path);
        File f = new File(path);
        try {
            String[] list = f.list();
            if (list == null) {
                return new String[0];
            }
            String base = f.getCanonicalPath();
            if (!base.endsWith(SysProperties.FILE_SEPARATOR)) {
View Full Code Here

                file = new File(files[i]);
            } else {
                file = new File(dir, files[i]);
            }
            if (file.isDirectory()) {
                addFiles(file, file.list());
            } else {
                addFile(file);
            }
        }
    }
View Full Code Here

       
        if (!isLoggedIn()) return;
       
        File dir = new File(DataCrow.webDir, "/images/modules/");
        dir.mkdirs();
        String[] files = dir.list();
        if (files != null) {
            for (String file : files)
                new File(DataCrow.webDir, "/images/modules/" + file).delete();
        }
       
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.