Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 73745 Details for
Bug 196211
[Move][FTP][Local] Move a folder to a directory that contains a folder by that name errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Try java File.renameTo if it returns false use copy/delete
patch.txt (text/plain), 1.64 KB, created by
Kevin Doyle
on 2007-07-13 10:57:11 EDT
(
hide
)
Description:
Try java File.renameTo if it returns false use copy/delete
Filename:
MIME Type:
Creator:
Kevin Doyle
Created:
2007-07-13 10:57:11 EDT
Size:
1.64 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.services.local >Index: src/org/eclipse/rse/internal/services/local/files/LocalFileService.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/files/LocalFileService.java,v >retrieving revision 1.11 >diff -u -r1.11 LocalFileService.java >--- src/org/eclipse/rse/internal/services/local/files/LocalFileService.java 4 Jul 2007 18:24:36 -0000 1.11 >+++ src/org/eclipse/rse/internal/services/local/files/LocalFileService.java 13 Jul 2007 14:46:59 -0000 >@@ -17,6 +17,7 @@ > * Kevin Doyle (IBM) - [182221] Throwing Proper Exceptions on create file/folder > * Xuan Chen (IBM) - Fix 189487 - copy and paste a folder did not work - workbench hang > * David McKnight (IBM) - [192705] Exception needs to be thrown when rename fails >+ * Kevin Doyle (IBM) - [196211] Move a folder to a directory that contains a folder by that name errors > ********************************************************************************/ > > package org.eclipse.rse.internal.services.local.files; >@@ -1067,7 +1068,17 @@ > { > File fileToMove = new File(srcParent, srcName); > File newFile = new File(tgtParent, tgtName); >- return fileToMove.renameTo(newFile); >+ // Try renameTo(newFile), will fail if newFile exists though >+ if (!fileToMove.renameTo(newFile)) >+ { >+ if (copy(srcParent, srcName, tgtParent, tgtName, monitor)) >+ { >+ return delete(srcParent, srcName, monitor); >+ } >+ else return false; >+ } >+ return true; > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 196211
:
73699
|
73745
|
73857