Package java.io

Examples of java.io.File.canWrite()


      {
        getStatusBar().setStatus(StatusType.ERROR,
            getResources().getString("pdfsavedialog.targetIsNoFile")); //$NON-NLS-1$
        return false;
      }
      if (f.canWrite() == false)
      {
        getStatusBar().setStatus(StatusType.ERROR,
            getResources().getString("pdfsavedialog.targetIsNotWritable")); //$NON-NLS-1$
        return false;
      }
View Full Code Here


      {
        getStatusBar().setStatus(StatusType.ERROR,
            getResources().getString("plain-text-exportdialog.targetIsNoFile")); //$NON-NLS-1$
        return false;
      }
      if (f.canWrite() == false)
      {
        getStatusBar().setStatus(StatusType.ERROR,
            getResources().getString("plain-text-exportdialog.targetIsNotWritable")); //$NON-NLS-1$
        return false;
      }
View Full Code Here

          // copy-to location is %root$/videos, the root might exist but the sub-folder
          // not.
         
          File parent = copy_to.getParentFile();
         
          if ( parent != null && parent.canWrite()){
           
            copy_to.mkdir();
          }
         
          if ( !copy_to.exists()){
View Full Code Here

        try {
       
            if (!file.exists())
                file.createNewFile();
           
            if (!file.exists() || !file.canWrite())
                throw new IOException("File cannot be created in directory " + dir);

        } catch (Throwable e) {
             String message = "Data Crow does not have permissions to modify files in the " + name + " directory. " +
                "This indicates that the user running Data Crow has insufficient permissions. " +
View Full Code Here

        if(file.exists()) {
            if(!file.delete()) {
                throw new DbException("Could not delete symbol file: " + file.getAbsolutePath());
            }
        }
        if(file.canWrite()) {
            throw new IllegalStateException("Does not have write permission for "
                    + file.getAbsolutePath());
        }
        try {
            ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
View Full Code Here

        properties.setProperty(key, value);
      }
    }

    final File target = new File(baseDirectory, configPath);
    if (target.exists() == true && target.canWrite() == false)
    {
      return;
    }
    try
    {
View Full Code Here

      }
    }
    else
    {
      if (baseDirectoryFile.canRead() == false ||
          baseDirectoryFile.canWrite() == false)
      {
        throw new ModuleInitializeException
            ("Unable to access the specified directory."); //$NON-NLS-1$
      }
    }
View Full Code Here

    * @return null if not found
    */
   public static String directoryForWrite(String path) {
      if (path == null) return null;
      File file = new File(path);
      if (file.isDirectory() && file.canWrite()) {
         return path;
      }
      if (file.getParentFile() == null) return null;
      String parent = file.getParentFile().getAbsolutePath();
      if (parent == null) return null;
View Full Code Here

           
            try {
                if(!oFile.exists()){
                    oFile.createNewFile();
                }
                if (oFile.canWrite()) {
                    outWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(oFile)));
                }
            } catch (FileNotFoundException e) {
                //Use logger to track SEVERE message.
                logger.log(Level.WARNING, "Can not find file " + outputFile + ", print outputs to void.", e);
View Full Code Here

            File eFile = new File(errFile);
            try {
                if(!eFile.exists()){
                    eFile.createNewFile();
                }
                if (eFile.canWrite()) {
                    errWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(eFile)));
                }
            } catch (FileNotFoundException e) {
                //Use logger to track SEVERE message.
                logger.log(Level.WARNING, "Can not find file " + errFile + ", print errors to void.", e);
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.