Package java.io

Examples of java.io.File.list()


                // Looks like we have a 32bit Java version installed on 64 bit Windows
                String programFiles = javaHome.substring(0, idx);
                File j = new File(programFiles, "Java");
                if(j.exists()) {
                  // We may have a 64 bit version of Java installed.
                  String[] jres = j.list();
                  for(int i=0;i<jres.length;i++) {
 
                    File h = new File(j, jres[i]);
                    File exe = new File(h, "bin\\java.exe");
                    if(exe.exists()) {
View Full Code Here


                //no defaultfile, send a dirlisting
                if (targetFile == null || !targetFile.exists() || (targetFile.exists() && targetFile.isDirectory())) {
                    final StringBuilder aBuffer = new StringBuilder();
                    aBuffer.append("<html>\n<head>\n</head>\n<body>\n<h1>Index of " + path + "</h1>\n  <ul>\n");
                    String[] list = targetFile.list();
                    if (list == null) list = new String[0]; // should not occur!
                    File f;
                    String size;
                    long sz;
                    String headline, author, description, publisher;
View Full Code Here

  public List getValues(HttpServletRequest request) {
    File dir = new File(new File(ContextHolder.getContext().getConfDirectory(), "site"), "icons");
    List l = new ArrayList();
    l.add(new Pair("default", "Default"));
    if(dir.exists() && dir.canRead()) {
      String[] names = dir.list();
      for(int i = 0 ; i < names.length; i++) {
        l.add(new Pair(names[i], names[i]));
      }
    }
    return l;
View Full Code Here

            solr = new SolrSingleConnector("http://127.0.0.1:8983/solr", new SolrScheme());
            solr.clear();
            final File exampleDir = new File("/Data/workspace2/yacy/test/parsertest/");
            long t, t0, a = 0;
            int c = 0;
            for (final String s: exampleDir.list()) {
                if (s.startsWith(".")) continue;
                t = System.currentTimeMillis();
                solr.add(new File(exampleDir, s), s);
                t0 = (System.currentTimeMillis() - t);
                a += t0;
View Full Code Here

   * @param element
   * @param type
   */
  public static void rechercherFichierSansSousDossiers(String element, ArrayList type) {
    File f = new File(element);
    String [] elements = f.list();
    if(elements != null)
      for(int i = 0 ; i < elements.length ; i++){
        String Fichier = element + File.separatorChar + elements[i];
        File fic = new File(Fichier);
       
View Full Code Here

  public static void rechercheFichierRecursive(String element, ArrayList type) {
    File f = new File(element);
    if(f.exists()) {
      // L'�l�ment est un dossier
      if(f.isDirectory()) {
        String [] elements = f.list();
        if(elements != null)
          for(int i = 0 ; i < elements.length ; i++)
            rechercheFichierRecursive(element + File.separatorChar + elements[i], type);
      }
      // L'�l�ment est un fichier
View Full Code Here

        parent.mkdirs();
       
        try {
            ZipExtract.extractZipFile(parent, new FileInputStream(file));
           
            String[] certs = parent.list(new FilenameFilter() {
              public boolean accept(File file, String filename) {
                return filename.endsWith(".crt") && (!filename.equals(actualCert) && !filename.equals(actualCert.replaceAll("\\*", "STAR")));
              }
            });
            String pw = Property.getProperty(new ContextKey("webServer.keystore.sslCertificate.password"));
View Full Code Here

        File f = new File(path);

        if (f.isFile() && path.endsWith(".java")) {
            vList.addElement(path);
        } else if (f.isDirectory()) {
            String list[] = f.list();

            for (int i = 0; i < list.length; i++) {
                addDir(path + File.separatorChar + list[i]);
            }
        }
View Full Code Here

                // Looks like we have a 32bit Java version installed on 64 bit Windows
                String programFiles = javaHome.substring(0, idx);
                File j = new File(programFiles, "Java");
                if(j.exists()) {
                  // We may have a 64 bit version of Java installed.
                  String[] jres = j.list();
                  for(int i=0;i<jres.length;i++) {
 
                    File h = new File(j, jres[i]);
                    File exe = new File(h, "bin\\java.exe");
                    if(exe.exists()) {
View Full Code Here

    String filename =  _path.getPath() + "/" + name;
    File dir = new File(filename);
    if (dir.exists() && dir.isDirectory()) {
      String latest_file = null;
      int latest_version = 0;
      String[] files = dir.list();
      if (files != null) {
        int n = files.length;
        for(int i=0; i<n; i++) {
          String file = files[i];
          if (file.startsWith("v_") && file.endsWith(".class")) {
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.