Package java.io

Examples of java.io.File.canWrite()


    if (!deployDir.equals(sarFile.getParentFile()))
      throw new IllegalArgumentException("Invalid deployment: " + name);

    if (sarFile.exists())
    {
      if (sarFile.canWrite() && sarFile.isFile())
      {
        _logger.info("Deployment {} already exist, overwrite it", name, null);
      }
      else
      {
View Full Code Here


            new Repository( "local", settings.getLocalRepository(), Repository.LAYOUT_DEFAULT, false, false );

        File repoLocalFile = new File( localRepository.getBasedir() );
        repoLocalFile.mkdirs();

        if ( !repoLocalFile.canWrite() )
        {
            throw new Exception( "Can't write to " + repoLocalFile );
        }

        ArtifactResolver resolver;
View Full Code Here

                throw new IllegalStateException("Could not create parent directory of log configuration file: " + file.getParent());
            }
        }

        // verify that the file is writable or does not exist
        if (file.exists() && !file.canWrite()) {
            throw new IllegalStateException("Configuration file is not writable: " + file.getAbsolutePath());
        }

        OutputStream out = null;
        try {
View Full Code Here

        if (!targetDir.isDirectory()) {
            log.error(
                    "Plugin install cannot write file " + data.getValue() + " to " + destDir + " because " + targetDir.getAbsolutePath() + " is not a directory");
            return;
        }
        if (!targetDir.canWrite()) {
            log.error(
                    "Plugin install cannot write file " + data.getValue() + " to " + destDir + " because " + targetDir.getAbsolutePath() + " is not writable");
            return;
        }
        int start = -1;
View Full Code Here

                }
            }
            if (target.isDirectory()) {
                continue;
            }
            if (!target.canWrite()) {
                log.error("Plugin install cannot write to file " + target.getAbsolutePath());
                continue;
            }
            copyFile(url.openStream(), new FileOutputStream(target));
        }
View Full Code Here

            }
        }
        if (!parent.canRead()) {
            throw new IOException("Unable to read manageable attribute files in directory " + parent.getAbsolutePath());
        }
        if (!readOnly && !parent.canWrite()) {
            throw new IOException("Unable to write manageable attribute files to directory " + parent.getAbsolutePath());
        }
    }

    private synchronized void attributeChanged() {
View Full Code Here

            else if ( !directoryFile.isDirectory() )
            {
                displayErrorMessage( Messages.getString( "ExportProjectsWizardPage.SelectedDirectoryNotDirectory" ) ); //$NON-NLS-1$
                return;
            }
            else if ( !directoryFile.canWrite() )
            {
                displayErrorMessage( Messages.getString( "ExportProjectsWizardPage.SelectedDirectoryNotWritable" ) ); //$NON-NLS-1$
                return;
            }
        }
View Full Code Here

            {
                displayErrorMessage( Messages
                    .getString( "ExportSchemasAsOpenLdapWizardPage.ErrorSelectedDirectoryNotDirectory" ) ); //$NON-NLS-1$
                return;
            }
            else if ( !directoryFile.canWrite() )
            {
                displayErrorMessage( Messages
                    .getString( "ExportSchemasAsOpenLdapWizardPage.ErrorSelectedDirectoryNotWritable" ) ); //$NON-NLS-1$
                return;
            }
View Full Code Here

                {
                    displayErrorMessage( Messages
                        .getString( "ExportSchemasForADSWizardPage.ErrorSelectedDirectoryNotDirectory" ) ); //$NON-NLS-1$
                    return;
                }
                else if ( !directoryFile.canWrite() )
                {
                    displayErrorMessage( Messages
                        .getString( "ExportSchemasForADSWizardPage.ErrorSelectedDirectoryNotWritable" ) ); //$NON-NLS-1$
                    return;
                }
View Full Code Here

        {
            String emsg = "Could not make directory '" + path.getAbsolutePath() + "'.";

            // Add assistive message in case of failure.
            File basedir = new File( getRepository().getBasedir() );
            if ( !basedir.canWrite() )
            {
                emsg += "  The base directory " + basedir + " is read-only.";
            }

            throw new TransferFailedException( emsg );
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.