Package java.io

Examples of java.io.File.list()


      dirT = args[ 0 ] +"/text"; // "/local/robb/data/grib/idd/text";
    }
    File dir = new File( dirB );
    if (dir.isDirectory()) {
      System.out.println("In directory " + dir.getParent() + "/" + dir.getName());
      String[] children = dir.list();
      for (String child : children) {
        //System.out.println( "children i ="+ children[ i ]);
        File aChild = new File(dir, child);
        //System.out.println( "child ="+ child.getName() );
        if (aChild.isDirectory()) {
View Full Code Here


      dirB1 = args[0] + "/gempak";
    }
    File dir = new File(dirB1);
    if (dir.isDirectory()) {
      System.out.println("In directory " + dir.getParent() + "/" + dir.getName());
      String[] children = dir.list();
      for (String child : children) {
        if ( child.endsWith( ".gem" ) ) {
          if( child.startsWith( "air"))
            continue;
          System.out.println("\n\nReading File " + dirB1 + "/" + child);
View Full Code Here

      String currentDirectoryPath = (String) it.next();
      if (!excludedFromPrune.contains(currentDirectoryPath)) {
        File instance = new File(currentDirectoryPath);
        // If it has already been deleted, its OK
        if (instance.exists()) {
          if (!instance.canWrite() || instance.list().length > 0) {
            excludeDirectory(currentDirectoryPath);
          } else {
            if (!instance.delete()) {
              result.add(currentDirectoryPath);
            }
View Full Code Here

            if (!dirSet.contains(dirName)) {
                String path = outPutDir + "/" + dirName;
                dirSet.add(path);
                File file = new File(path);
                if (file.isDirectory()) {
                    for (String str : file.list()) {
                        if (str.endsWith("java")) {
                            argList.add(path + File.separator + str);
                        } else {
                            // copy generated xml file or others to class
                            // directory
View Full Code Here

    private Collection filesInPackage(String packageName) {
      if(!map.containsKey(packageName)) {
        File f = new File(folder, packageName.replace('.', File.separatorChar));
        Collection c = Collections.EMPTY_LIST;
        if(f.exists() && f.isDirectory()) {
          String[] files = f.list();
          if(files.length > 0) {
            c = new HashSet();
            for(int i = 0; i < files.length; i++)
              c.add(files[i]);
          }
View Full Code Here

    // create filename filter and attach to directory
    OldFileNameFilter fileFilter = new OldFileNameFilter(fileBase);

    // get list of files using that base name
    String fileNames[] = dir.list(fileFilter);
    if (fileNames == null || fileNames.length <= numberToKeep)
      return// not too many old files

    // we do not expect a lot of files in this directory,
    // so just do things linearly
View Full Code Here

    */
   private void readCertsFromHarddrive() throws StorageResolverException {

      File certDir = new File(this._merlinsCertificatesDir);
      ArrayList al = new ArrayList();
      String[] names = certDir.list();

      for (int i = 0; i < names.length; i++) {
         String currentFileName = names[i];

         if (currentFileName.endsWith(".crt")) {
View Full Code Here

        if (!path.isDirectory() && !path.mkdirs()) {
            com.valhalla.Logger
                    .debug("Could not create user defined settings directories.");
        } else {
            userThemes = path.list();
            for (int i = 0; i < userThemes.length; i++) {
                if (!current.equals(userThemes[i])) {
                    box.addItem(userThemes[i]);
                }
            }
View Full Code Here

      logger.error("avatar dir property not config properly");
      return Pages.emptyPage();
    }
    File file = new File(avatarDir);
    if (!file.exists()) { return Pages.emptyPage(); }
    String[] names = file.list();
    List<String> fileNames = CollectUtils.newArrayList();
    for (int i = 0; i < names.length; i++) {
      String name = StringUtils.substringBefore(names[i], ".");
      String ext = StringUtils.substringAfter(names[i], ".");
      if (StringUtils.isNotBlank(name) && containType(ext)) {
View Full Code Here

  public static void main(String[] args) {
    ApplicationArguments.initialize(new String[0]);
    ProgressDialogControllerImpl controller = new ProgressDialogControllerImpl();
   
    File coreDownloadsDir = new File("/opt/squirrel/eclipse_build/update/downloads/core");
    String[] fileList = coreDownloadsDir.list();
   
   
    controller.showProgressDialog("File Backup", "Backing up file:", fileList.length);
    int count = 0;
    while (count < fileList.length) {
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.