Examples of canWrite()


Examples of java.io.File.canWrite()

    File cacheIndex = null;
    if ( indexFile != null )
      cacheIndex = DiskCache.getFile( indexFile.getPath(), true);
    if ( cacheIndex != null && cacheIndex.exists())
    {
      if ( ! cacheIndex.canWrite())
        fail( "Cannot write/remove cache index file [" + cacheIndex.getPath() + "].");
      else if ( cacheIndex.exists() )
        cacheIndex.delete();
    }
    cacheIndex = null;
View Full Code Here

Examples of java.io.File.canWrite()

    cacheIndex = null;
    if ( indexFile != null )
      cacheIndex = DiskCache.getFile( GribIndexName.get(indexFile.getPath()), true);
    if ( cacheIndex != null && cacheIndex.exists())
    {
      if ( ! cacheIndex.canWrite())
        fail( "Cannot write/remove cache index file [" + cacheIndex.getPath() + "].");
      else if ( cacheIndex.exists() )
        cacheIndex.delete();
    }
  }
View Full Code Here

Examples of java.io.File.canWrite()

    File prevFile = new File(location);
    File tmpFile = new File(location+".tmp");
    if (tmpFile.exists()) tmpFile.delete();
    if (!prevFile.renameTo(tmpFile)) {
      System.out.println(prevFile.getPath()+ " prevFile.exists "+prevFile.exists()+" canRead = "+ prevFile.canRead());
      System.out.println(tmpFile.getPath()+" tmpFile.exists "+tmpFile.exists()+" canWrite "+ tmpFile.canWrite());
      throw new RuntimeException("Cant rename "+prevFile.getAbsolutePath()+" to "+ tmpFile.getAbsolutePath());
    }

    NetcdfFile oldFile = NetcdfFile.open(tmpFile.getPath());
View Full Code Here

Examples of java.io.File.canWrite()

      String currentDirectoryPath = (String) it.next();
      if (!excludedFromPrune.contains(currentDirectoryPath)) {
        File instance = new File(currentDirectoryPath);
        // If it has already been deleted, its OK
        if (instance.exists()) {
          if (!instance.canWrite() || instance.list().length > 0) {
            excludeDirectory(currentDirectoryPath);
          } else {
            if (!instance.delete()) {
              result.add(currentDirectoryPath);
            }
View Full Code Here

Examples of java.io.File.canWrite()

   *
   * @see entagged.tageditor.tools.renaming.data.stat.Prop#operate(entagged.tageditor.tools.renaming.data.AbstractFile)
   */
  public int operate(AbstractFile file) {
    File tmp = getFile(file.getPath());
    int result = tmp.exists() && !tmp.canWrite() ? 1 : 0;
    // if one can modify the given file and it is not a directory,
    // the directory must be tested, where the file resides
    if (result == 0 && !file.isDirectory()) {
      result = this.operate(file.getParent());
    }
View Full Code Here

Examples of javax.microedition.io.file.FileConnection.canWrite()

            props.append(new StringItem(T._("Type"), fc.isDirectory() ? T._("Directory") : T._("Regular File")));
            props.append(new StringItem(T._("Size"), Long.toString((fc.isDirectory() ? fc.directorySize(true) : fc.fileSize()))));
            props.append(new StringItem(T._("Modified"), myDate(fc.lastModified())));

            ChoiceGroup attrs = new ChoiceGroup(T._("Attributes"), Choice.MULTIPLE, attrList, null);
            attrs.setSelectedFlags(new boolean[] { fc.canRead(), fc.canWrite(), fc.isHidden() });
            props.append(attrs);

            if (fileName.toLowerCase().endsWith(".sgf"))
                try {
                    StringBuffer sb = new StringBuffer();
View Full Code Here

Examples of jcifs.smb.SmbFile.canWrite()

      if (smbShare.isUseTempFile()) {

        String tempFileName = _path + smbShare.newTempFileSuffix();
        SmbFile tempFile = createSmbFileObject(tempFileName);
        tempFile.createNewFile();
        Assert.isTrue(tempFile.canWrite(), "Temporary file [" + tempFileName + "] is not writable.");

        FileCopyUtils.copy(_inputStream, tempFile.getOutputStream());

        if (targetFile.exists() && smbShare.isReplaceFile()) {
          targetFile.delete();
View Full Code Here

Examples of net.rim.device.api.io.file.ExtendedFileConnection.canWrite()

        try {
            fConnWrap = new FileConnectionWrapper( args[ 0 ].toString() );
            ExtendedFileConnection fConn = (ExtendedFileConnection) fConnWrap.getFileConnection();

            Boolean isReadonly = new Boolean( !fConn.canWrite() );
            Boolean isHidden = new Boolean( fConn.isHidden() );
            Double size = new Double( fConn.fileSize() );
            Date dateModified = new Date( fConn.lastModified() );

            int dotIndex = ( args[ 0 ].toString() ).lastIndexOf( (int) '.' );
View Full Code Here

Examples of net.sourceforge.ganttproject.document.Document.canWrite()

        if (project.getDocument()==null) {
            saveProjectAs(project);
            return;
        }
        Document document = project.getDocument();
        if (!document.canWrite()) {
            myWorkbenchFacade.showErrorDialog(i18n.getText("msg10"));
            saveProjectAs(project);
            return;
        }
        if (!document.acquireLock()) {
View Full Code Here

Examples of org.apache.beehive.netui.compiler.genmodel.GenStrutsApp.canWrite()

       
        if ( strutsConfigFile != null )
        {
            getFCSourceFileInfo().addReferencedFile( strutsConfigFile );
           
            if ( strutsConfigFile.exists() && strutsApp != null && ! strutsApp.canWrite() )
            {
                getDiagnostics().addError( jclass, "error.struts-config-not-writable", strutsConfigFile );
            }
        }
       
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.