Package java.io

Examples of java.io.File.mkdirs()


        // 2) then quickly delete the file and...
        // 3) convert it to a directory

        File tmpDir = File.createTempFile(prefix, suffix, parentDirectory); // create file with unique name
        boolean deleteOk = tmpDir.delete(); // delete the tmp file and...
        boolean mkdirsOk = tmpDir.mkdirs(); // ...convert it to a directory

        if (!deleteOk || !mkdirsOk) {
            throw new IOException("Failed to create temp directory named [" + tmpDir + "]");
        }
View Full Code Here


      // grab file's parent directory structure
      File destinationParent = destFile.getParentFile();

      // create the parent directory structure if needed
      destinationParent.mkdirs();

      // extract file if not a directory
      if (!entry.isDirectory()) {
        ObjectConverterUtil.write(zipFile.getInputStream(entry),
            destFile);
View Full Code Here

  pos = i;
  i = -1;
      }
    }
    File dir = new File(filename.substring(0, pos));
    dir.mkdirs();
  }
 

  /**
   * gets the value of minFileSize. Files smaller then this size
View Full Code Here

        // Get DB directory
        final File h2Dir = new File(dataDir, H2_DATA_DIR);

        if (!h2Dir.exists())
        {
            h2Dir.mkdirs();
        }
        else if (!h2Dir.isDirectory())
        {
            throw new IOException("Failed to create directory: " + h2Dir);
        }
View Full Code Here

   */
  public void setTvDataDir(File dir) {
    for (TvDataServiceProxy proxy : getDataServices()) {
      File dataServiceDir=new File(dir,proxy.getId());
      if (!dataServiceDir.exists()) {
        dataServiceDir.mkdirs();
      }
      proxy.setWorkingDirectory(dataServiceDir);
    }
  }

View Full Code Here

  public void init() {
    try {
      String tvdataRoot = Settings.propTVDataDirectory.getString();
      File rootDir = new File(tvdataRoot);
      if (!rootDir.exists()) {
        rootDir.mkdirs();
      }
      setTvDataDir(rootDir);

      // load only the settings of services with current subscription
      TvDataServiceProxy[] proxies = getDataServices();
View Full Code Here

    if (dirName == null) {
      file = new File(dir, name);
    } else {
      File parentDir = new File(dir, dirName);
      if (!parentDir.exists()) {
        parentDir.mkdirs();
      }
      file = new File(parentDir, name);
    }

    if (useFileOutputStream ) {
View Full Code Here

        basePath = arg0;
      if(!basePath.endsWith(File.separator))
        basePath += File.separator;
      File f = new File(basePath);
      if(!f.exists())
        f.mkdirs();
    }
  }
 
  /**
   * �������ͺͱ������ȡ�ı�����
 
View Full Code Here

  public void saveSettings() {
    final File currentDir = new File(mCurrentTvDataDir);
    final File newDir = new File(mTVDataFolderPanel.getText());
   
    if(!newDir.exists()) {
      newDir.mkdirs();
    }
   
    if(!currentDir.equals(newDir)) {
     
      Window parent = UiUtilities.getLastModalChildOf(MainFrame.getInstance());
View Full Code Here

    dir.append(File.separator);
    File file = new File(dir.toString());
    if(!file.exists()){
      //���Ŀ¼�������򴴽�Ŀ¼
      synchronized(FileSystemSaver.class){
        if(!file.mkdirs())
          return null;
      }
    }
    file = null;
    int times = 0;
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.