Package java.io

Examples of java.io.File.mkdir()


      if (subDirName == null || subDirName.trim().length() < 1)
         throw new Exception("The subdirectory to be used to store the initial data is empty");
      File subDir = new File(dirWhereToStore, subDirName);
      String completeSubdirName = subDir.getAbsolutePath();
      if (!subDir.exists()) {
         if (!subDir.mkdir()) {
            String txt = "could not make '" + completeSubdirName + "' to be a directory. Check your rights";
            log.severe(txt);
            throw new Exception(txt);
         }
      }
View Full Code Here


         if (!tmp.canWrite())
            throw new Exception("Can not write in directory '" + subDir + "' in '" + directory.getAbsolutePath() + "'.");
        
         for (int i=0; i < list.size(); i++) {
            tmp = new File(tmp, (String)list.get(i));
            tmp.mkdir();
         }
         dir = tmp;
      }
     
      File file = new File(dir, fileName);
View Full Code Here

      }
      cleanUpDirs();
     
      try {
         file = new File(this.dirName);
         boolean ret = file.mkdir();
         assertTrue("could not create directory '" + this.dirName + "'", ret);
         file = new File(this.dirNameSent);
         file.createNewFile();
      }
      catch (IOException ex) {
View Full Code Here

      }
      cleanUpDirs();
     
      try {
         file = new File(this.pollerDirName);
         boolean ret = file.mkdir();
         assertTrue("could not create directory '" + this.pollerDirName + "'", ret);
         file = new File(this.pollerDirNameSent);
         file.createNewFile();
      }
      catch (IOException ex) {
View Full Code Here

      }
      cleanUpDirs();
     
      try {
         file = new File(this.dirName);
         boolean ret = file.mkdir();
         assertTrue("could not create directory '" + this.dirName + "'", ret);
         file = new File(this.dirNameSent);
         file.createNewFile();
      }
      catch (IOException ex) {
View Full Code Here

    if (lockDir.exists()) {
      removeInvalidLock(lockDir);
    }

    if (!lockDir.mkdir()) {
      return null;
    }

    Lock lock = null;
View Full Code Here

                        }
                        else
                        {
                            final File targetDirectory = new File(explodedEarDirectory,
                                    file.getName());
                            targetDirectory.mkdir();
                            FileUtils.copyDirectory(
                                file,
                                targetDirectory);
                        }
                    }
View Full Code Here

    private URLClassLoader classLoader;

    public void setUp() throws Exception {
        super.setUp();     
        File classFile = new java.io.File(output.getCanonicalPath() + "/classes");
        classFile.mkdir();
        System.setProperty("java.class.path", getClassPath() + classFile.getCanonicalPath()
                           + File.separatorChar);
        classLoader = AnnotationUtil.getClassLoader(Thread.currentThread().getContextClassLoader());
        env.put(ToolConstants.CFG_COMPILE, "compile");
        env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
View Full Code Here

    String dirName = "C:/temp/aggManyFiles/";
    int n = 20000;

    File dir = new File(dirName);
    if (!dir.exists())
      dir.mkdir();

    int count = 0;
    String stub = "Test";
    NetcdfFile org = NetcdfFile.open("C:/data/CM2006172_180000h_u25h.nc");
    for(int i=0; i<n; i++) {
View Full Code Here

      listDir = new File("log");
    }
    try {
      // Create the directory if doesn't exist
      if (!listDir.exists()) {
        if (!listDir.mkdir()) {
          throw new IOException("Creating directory failed: " + listDir.getAbsolutePath());
        }
      }
    } catch (IOException exc) {
      logError("Writing deadlink list and error list failed", exc, false);
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.