Package java.io

Examples of java.io.File.renameTo()


          partFile.delete();
          return Status.CANCEL_STATUS;
        }

        /* Now copy over the part file to the actual file in an atomic operation */
        if (!partFile.renameTo(downloadFile)) {
          downloadFile.delete();
          partFile.renameTo(downloadFile);
        }
      }
    } catch (ConnectionException e) {
View Full Code Here


        }

        /* Now copy over the part file to the actual file in an atomic operation */
        if (!partFile.renameTo(downloadFile)) {
          downloadFile.delete();
          partFile.renameTo(downloadFile);
        }
      }
    } catch (ConnectionException e) {
      return Activator.getDefault().createErrorStatus(e.getMessage(), e);
    }
View Full Code Here

      File compressedLayer = new File(layerDirectory, layerName + ".js");
      log.info("Deleting " + compressedLayer.getAbsolutePath());
      compressedLayer.delete();
      File uncompressedLayer = new File(layerDirectory, layerName + ".js.uncompressed.js");
      log.info("Renaming " + uncompressedLayer.getAbsolutePath() + " to " + compressedLayer.getAbsolutePath());
      uncompressedLayer.renameTo(compressedLayer);
    }
    archive();
  }

  public File getTargetJar() {
View Full Code Here

      outputStream.close();

      // Now that we have the generated file, move it to its proper location
      if (!configFile.delete())
         throw new Exception("Update failed for '" + name + "', unable to delete old configuration file: " + path);
      if (!outputFile.renameTo(configFile))
         throw new Exception("Update failed for '" + name + "', unable to move configuration file to deploy directory: " + path);
   }
}
View Full Code Here

      fc.close();
      fos.close();
      raf.close();
      if( javaFile.delete() == false )
         log.severe("Failed to delete java file: "+javaFile);
      if( bakFile.renameTo(javaFile) == false )
         throw new SyncFailedException("Failed to replace: "+javaFile);
   }

   /**
    * Add the default jboss lgpl header
View Full Code Here

      // temporary form item scope. The file must be moved later using the
      // moveUploadFileTo() method to the final destination.
      tempUploadFile = new File(WebappHelper.getUserDataRoot() + "/tmp/" + CodeHelper.getGlobalForeverUniqueID());
      File tmpRequestFile = getRootForm().getRequestMultipartFile(component.getFormDispatchId());
      // Move file to internal temp location
      boolean success = tmpRequestFile.renameTo(tempUploadFile);
      if (!success) {
        // try to move file by copying it, command above might fail
        // when source and target are on different volumes
        FileUtils.copyFileToFile(tmpRequestFile, tempUploadFile, true);
      }
View Full Code Here

            xmlenc.writeObject(tables);
            xmlenc.close();
           
            // delete old file and rename tmp-file to old file's name
            FileUtils.deletedelete(this.propFile);
            tmpFile.renameTo(this.propFile);

            // set the new time stamp
            timestamp = System.currentTimeMillis();
        }
    }
View Full Code Here

                e.writeXML(osw);
                c++;
                if (c >= maxEntriesInFile) {
                    osw.write("</surrogates>\n");
                    osw.close();
                    outputfiletmp.renameTo(outputfile);
                    osw = null;
                    c = 0;
                    fc++;
                }
            }
View Full Code Here

                    fc++;
                }
            }
            osw.write(SurrogateReader.SURROGATES_MAIN_ELEMENT_CLOSE + "\n");
            osw.close();
            outputfiletmp.renameTo(outputfile);
            return fc + 1;
        } catch (MalformedURLException e) {
            Log.logException(e);
        } catch (UnsupportedEncodingException e) {
            Log.logException(e);
View Full Code Here

   
    public static void integrateOpenGeoDB() {
        File geo1 = Dictionary.GEODB1.file();
        File geo0 = Dictionary.GEODB0.file();
        if (geo1.exists()) {
            if (geo0.exists()) geo0.renameTo(Dictionary.GEODB0.fileDisabled());
            geoLoc.addLocalization(Dictionary.GEODB1.nickname, new OpenGeoDBLocalization(geo1, false));
            return;
        }
        if (geo0.exists()) {
            geoLoc.addLocalization(Dictionary.GEODB0.nickname, new OpenGeoDBLocalization(geo0, false));
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.