@Override public void renameTo ( SmbResource d ) throws SmbException { renameTo(d, false); }
@Override public void renameTo ( SmbResource d ) throws SmbException { renameTo(d, false); }
public static void renameSmbFile(SmbFile srcFile, String completeUrl, NtlmPasswordAuthentication auth) throws Exception { SmbFile newFile = new SmbFile(completeUrl,auth); srcFile.renameTo(newFile); }
@Override protected void doRename(FileObject newfile) throws Exception { file.renameTo(createSmbFile(newfile.getName())); }
@Override protected void doRename(final FileObject newfile) throws Exception { file.renameTo(createSmbFile(newfile.getName())); }
/** * Implementation notes: server-to-server renaming will work if the destination file also uses the 'SMB' scheme. * Hosts do not necessarily have to be the same for this operation to succeed. */ @Override public void renameTo(AbstractFile destFile) throws IOException { // Throw an exception if the file cannot be renamed to the specified destination. // This method fails in situations where SFTPFile#renameTo() doesn't, for instance: // - when the source and destination are the same // - when the source file doesn't exist checkRenamePrerequisites(destFile, true, true); // Attempt to move the file using jcifs.smb.SmbFile#renameTo. boolean isDirectory = file.isDirectory(); // Rename the file file.renameTo(((SMBFile)destFile).file); // Ensure that the destination jcifs.smb.SmbFile's path is consistent with its new directory/non-directory state ((SMBFile)destFile).checkSmbFile(isDirectory); }
smbFromFile.renameTo(smbToFile); } catch (IOException e) {
@Override public void rename(String _pathFrom, String _pathTo) throws IOException { try { SmbFile smbFileFrom = createSmbFileObject(_pathFrom); SmbFile smbFileTo = createSmbFileObject(_pathTo); if (this.smbShare.isReplaceFile() && smbFileTo.exists()) { smbFileTo.delete(); } smbFileFrom.renameTo(smbFileTo); } catch (SmbException _ex) { throw new NestedIOException("Failed to rename [" + _pathFrom + "] to [" + _pathTo + "].", _ex); } if (logger.isInfoEnabled()) { logger.info("Successfully renamed remote resource [" + _pathFrom + "] to [" + _pathTo + "]."); } }
public void pullUp(String from, String to) throws IOException, InterruptedException { SmbFile src = $(from); SmbFile dst = $(to); for (SmbFile e : src.listFiles()) { e.renameTo(new SmbFile(dst,e.getName())); } src.delete(); }
public void pullUp(String from, String to) throws IOException, InterruptedException { SmbFile src = $(from); SmbFile dst = $(to); for (SmbFile e : src.listFiles()) { e.renameTo(new SmbFile(dst,e.getName())); } src.delete(); }
targetFile.delete(); tempFile.renameTo(targetFile);