Examples of renameTo()


Examples of java.io.File.renameTo()

            }
            failedFile = new File(failedPath + this.getFailedPrefix() + failedName);
           
            messageFile = new File(workFile.getAbsolutePath() + "~");
            if (messageFile.exists()) messageFile.delete();
            workFile.renameTo(messageFile);
           
            // populate mailer with settings
            if (this.sosMailSettings != null) {
                sosMail = new SOSMail( this.sosMailSettings );
            } else {
View Full Code Here

Examples of java.io.File.renameTo()

            File fInNew = new File(fIn.getParent(), getNewUniqueName(fileName));
            fIn.renameTo(fInNew);
            // copy
            success = FileUtils.copyFileToDir(fInNew, fDropbox);
            // rename to old name
            fInNew.renameTo(fIn);
            fIn = fInNew;
          } else {
            success = FileUtils.copyFileToDir(fIn, fDropbox);
          }
        } else {
View Full Code Here

Examples of java.io.File.renameTo()

         out.write(dumpMessage(withAttachment));
      
         targetFile = new File(file.getAbsolutePath().replaceFirst("~$",""));
         tmpFile.delete();

         tmpFile.renameTo(targetFile);
                
      }catch (Exception e){
         throw new Exception(SOSClassUtil.getMethodName() + ": An error occurred on dumping: " + e.toString() );
       } finally {
         if ( out != null) try { out.close(); } catch(Exception e) {}
View Full Code Here

Examples of java.io.File.renameTo()

   */
  public void rename(String newName) {
    // rename meta info file name
    if (isDirectory()) { // rename the directory, which is the parent of the actual ".xml" file
      File metaFileDirectory = metaFile.getParentFile();
      metaFileDirectory.renameTo(new File(metaFileDirectory.getParentFile(), newName));
    } else { // rename the file
      metaFile.renameTo(new File(metaFile.getParentFile(), newName + ".xml"));
    }
  }
 
View Full Code Here

Examples of java.io.File.renameTo()

    String importedCalendarID = getImportedCalendarID(ureq, calendarName);
    String importedCalendarType = getImportedCalendarType();
   
    CalendarManager calManager = CalendarManagerFactory.getInstance().getCalendarManager();
    File oldCalendarFile = calManager.getCalendarFile(importedCalendarType, tempCalendarID);
    oldCalendarFile.renameTo(calManager.getCalendarFile(importedCalendarType, importedCalendarID));
   
    // make the entry in the database
    long timestamp = System.currentTimeMillis();
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.createUserPropertyInstance(ureq.getIdentity(), PROP_CATEGORY, sanitize(calendarName), null, timestamp, importUrl, null);
View Full Code Here

Examples of java.io.File.renameTo()

      final File dst = new File(logdir, LOGBASE + i);
      final File src = new File(logdir, LOGBASE + (i - 1));
      if (dst.exists()) {
        dst.delete();
      }
      src.renameTo(dst);
    }
  }

  /**
   * Copies previous logs (assuming they have the same file name as
View Full Code Here

Examples of java.io.File.renameTo()

              path = new File(path, "#" + txtPort.getText()).getCanonicalPath();




            if(f.renameTo(new File(path))) { 
              if(type == SCHEDULER_HOST) {
                //port �ndern
                tree.getSelection()[0].getParentItem().setText(txtName.getText());
                tree.getSelection()[0].setText(txtPort.getText());                     
                tree.getSelection()[0].setData( path);
View Full Code Here

Examples of jcifs.smb.SmbFile.renameTo()

            file = toSMB(file);
            to = toSMB(to);

            SmbFile src = new SmbFile(file, getAuth());

            src.renameTo(new SmbFile(to, getAuth()));

            return true;
        }
        catch(Exception ex)
        {
View Full Code Here

Examples of org.apache.derby.io.StorageFile.renameTo()

                        if (replace)
                        {
                            backupFile = storageFactory.newStorageFile( PersistentService.PROPERTIES_NAME.concat("old"));
                            try
                            {
                                if(!servicePropertiesFile.renameTo(backupFile))
                                    throw StandardException.newException(SQLState.UNABLE_TO_RENAME_FILE,
                                                                         servicePropertiesFile, backupFile);
                            }
                            catch (SecurityException se) { throw Monitor.exceptionStartingModule(se); }
                        }
View Full Code Here

Examples of org.apache.twill.filesystem.Location.renameTo()

    } finally {
      os.close();
    }

    // Rename the tmp file into the credentials location
    tmpLocation.renameTo(credentialsLocation);

    LOG.debug("Secure store for {} {} saved to {}.", application, runId, credentialsLocation.toURI());
  }

  private static LocationFactory createDefaultLocationFactory(Configuration configuration) {
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.