Package java.io

Examples of java.io.File.mkdirs()


    dir = new File( dir, "devices" );
    
     if ( !dir.exists()){
      
       if ( !dir.mkdirs()){
        
         throw( new IOException( "Failed to create '" + dir + "'" ));
       }
     } 
    
View Full Code Here


  {
    File file = plugin_interface.getPluginconfig().getPluginUserFile( "assets" );
   
    if ( !file.exists()){
     
      file.mkdirs();
    }
   
    return( file );
  }
 
View Full Code Here

        try {
            // Configure logging to a file, creating log dir if needed
            System.setProperty("org.apache.commons.logging.LogFactory", "org.mortbay.log.Factory");
            File logDir = new File(homeDir, "logs");
            if (!logDir.exists()) {
                logDir.mkdirs();
            }
            File logFile = new File(logDir, "admin-console.log");
            OutputStreamLogSink logSink = new OutputStreamLogSink(logFile.toString());
            logSink.start();
            LogImpl log = (LogImpl) Factory.getFactory().getInstance("");
View Full Code Here

      // 上传的路径
      File target = new File(this.isAbsolute ? this.uploadPath : hRequest
          .getSession().getServletContext().getRealPath(this.uploadPath));
      if (!target.exists()){
        try {
          target.mkdirs();
        } catch (Exception e) {
          throw new ServletException(e);
        }
      }
View Full Code Here

    try {
      boolean create = !indexDir.exists();
      if (create) {
        log.debug( "index directory not found, creating: '" + indexDir.getAbsolutePath() + "'" );
        try {
          indexDir.mkdirs();
        } catch (Exception e) {
          throw new RuntimeException(e);
        }
      }
      indexName = indexDir.getCanonicalPath();
View Full Code Here

    File file = new File(request.getSession().getServletContext()
        .getRealPath(resourceUrl));
    File parentFile = file.getParentFile();
    if(parentFile != null && !parentFile.exists()){
      try {
        parentFile.mkdirs();
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    FileOutputStream fout = null;
View Full Code Here

      final File directory = file.getParentFile();
      if (directory != null)
      {
        if (directory.exists() == false)
        {
          if (directory.mkdirs() == false)
          {
            XSSFExcelExportTask.logger.warn("Can't create directories. Hoping and praying now.."); //$NON-NLS-1$
          }
        }
      }
View Full Code Here

      final File directory = file.getAbsoluteFile().getParentFile();
      if (directory != null)
      {
        if (directory.exists() == false)
        {
          if (directory.mkdirs() == false)
          {
            CSVTableExportTask.logger.warn("Can't create directories. Hoping and praying now.."); //$NON-NLS-1$
          }
        }
      }
View Full Code Here

      final File directory = file.getParentFile();
      if (directory != null)
      {
        if (directory.exists() == false)
        {
          if (directory.mkdirs() == false)
          {
            ExcelExportTask.logger.warn("Can't create directories. Hoping and praying now.."); //$NON-NLS-1$
          }
        }
      }
View Full Code Here

      final File directory = file.getParentFile();
      if (directory != null)
      {
        if (directory.exists() == false)
        {
          if (directory.mkdirs() == false)
          {
            RTFExportTask.logger.warn("Can't create directories. Hoping and praying now.."); //$NON-NLS-1$
          }
        }
      }
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.