Package java.io

Examples of java.io.File.mkdir()


   * Try to read/write a file with UTF-8 chars in the filename in a temporary directory.
   *
   */
  private void testUtf8FileSystem() {
    File tmpDir = new File(new File(WebappHelper.getUserDataRoot()), "tmp");
    if (!tmpDir.exists()) tmpDir.mkdir();
    File writeFile = new File(tmpDir, "UTF-8 test läsÖiç-首页|新");
    if (writeFile.exists()) {
      // remove exising files first
      writeFile.delete();
    }
View Full Code Here


    try {
      File tmpFile = File.createTempFile(prefix, suffix, directory);
      if(tmpFile.exists()) {
        tmpFile.delete();
      }
      boolean tmpDirCreated = tmpFile.mkdir();
      if(tmpDirCreated) {
        tmpDir = tmpFile;
      }     
    } catch (Exception e) {
      //bummer!
View Full Code Here

      // "copy" the container means creating a folder with that name
      // and let the children copy

      // create the folder
      File outdir = new File(basefile, sourcename);
      outdir.mkdir();
      LocalFolderImpl rootcopyfolder = new LocalFolderImpl(outdir, this);

      List<VFSItem> children = sourcecontainer.getItems();
      for (VFSItem chd:children) {
        VFSStatus status = rootcopyfolder.copyFrom(chd, false);
View Full Code Here

  /**
   * @see org.olat.core.util.vfs.VFSContainer#createChildContainer(java.lang.String)
   */
  public VFSContainer createChildContainer(String name) {
    File fNewFile = new File(getBasefile(), name);
    if (!fNewFile.mkdir()) return null;
    LocalFolderImpl locFI =  new LocalFolderImpl(fNewFile, this);
    locFI.setDefaultItemFilter(defaultFilter);
    return locFI;
  }

View Full Code Here

   private void performModifications() throws Exception
   {
      // Create a war
      File dir = new File(farm0Dir, "huge.war");
      dir.mkdir();
     
      // Add a file we can request to verify deployment
      copyFile(dir, "farm-huge-index.html", "index.html");
     
      // Add a 150MB file to it
View Full Code Here

               try
               {
                  //Check if password directory exists
                  File passwordDir = new File("password");
                  if(passwordDir.exists() == false)
                     passwordDir.mkdir();
                 
                  FilePassword.main(filePasswordArgs);
               }
               catch (Exception e1)
               {
View Full Code Here

         if (passivationDir != null)
         {
            File base = new File(passivationDir);
            if (!base.exists())
            {
               if (!base.mkdir())
               {
                  throw new RuntimeException("Cannot create base passivation dir " + passivationDir);
               }

               cleanupPaths.add(base.getAbsolutePath());
View Full Code Here

      // Add of zipped content
      copyFile(farmDir, "hd-add-zipped.war");
     
      // Nested add
      File dir = new File(farmDir, "hd-nestedAdd");
      dir.mkdir();
      copyFile(dir, "hd-nested-add-deployment-service.xml");
     
      // New dir
      dir = new File(farmDir, "hd-newDirAdd");
      dir.mkdir();
View Full Code Here

      dir.mkdir();
      copyFile(dir, "hd-nested-add-deployment-service.xml");
     
      // New dir
      dir = new File(farmDir, "hd-newDirAdd");
      dir.mkdir();
      copyFile(dir, "hd-add-dir-deployment-service.xml");
     
      // Add of zipped content
      copyFile(farmDir, "hd-add-zipped.war");
     
View Full Code Here

      // ignore all ontologies imported during testing
      ont1.getDocumentManager().setProcessImports(false);
     
      File owlDir = new File(owl);
      if (!owlDir.exists()) try {
        owlDir.mkdir();
      } catch (Exception e) {
        e.printStackTrace();
      }

      File target = new File(owl, changeSuffix(src.getName(), "owl"));
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.