Skip to content

Commit

Permalink
Merge pull request #2445 in ITERATE/cyberduck from bugfix/CD-8363 to …
Browse files Browse the repository at this point in the history
…master

* commit '6489b36cb9aca6070b36f4913e822de236a8ccb0':
  Changes.
  Review.
  Check for source folder being already symlinked to new group container. Fix "File canonical paths are equals illegal argument" exception on startup.
  • Loading branch information
dkocher committed May 27, 2021
2 parents 042a0b9 + 6489b36 commit 2f26d4e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
3 changes: 3 additions & 0 deletions Changelog.txt
@@ -1,6 +1,9 @@
Cyberduck
https://cyberduck.io/

7.9.2
- [Bugfix] Failure opening application with previous application support directory symbolic link (macOS)

7.9.1
- [Bugfix] Slow synchronisation of a large folder (#11676)
- [Bugfix] Slow tranfer when using "compare" option for existing files (#11679)
Expand Down
Expand Up @@ -22,7 +22,6 @@
import ch.cyberduck.binding.foundation.NSURL;
import ch.cyberduck.core.Local;
import ch.cyberduck.core.exception.AccessDeniedException;
import ch.cyberduck.core.exception.LocalAccessDeniedException;
import ch.cyberduck.core.local.FinderLocal;
import ch.cyberduck.core.local.LocalSymlinkFactory;
import ch.cyberduck.core.local.LocalTrashFactory;
Expand Down Expand Up @@ -64,36 +63,31 @@ public Local find() {
// You should organize the contents of this directory in the same way that any other Library folder is organized
final String application = PreferencesFactory.get().getProperty("application.datafolder.name");
final Local folder = new FinderLocal(String.format("%s/Library/Application Support", group.path()), application);
try {
final Local previous = new ApplicationSupportDirectoryFinder().find();
if(previous.exists()) {
log.warn(String.format("Migrate application support folder from %s to %s", previous, folder));
// Rename folder recursively
final Local previous = new ApplicationSupportDirectoryFinder().find();
if(previous.exists() && !previous.isSymbolicLink()) {
log.warn(String.format("Migrate application support folder from %s to %s", previous, folder));
// Rename folder recursively
try {
FileUtils.copyDirectory(new File(previous.getAbsolute()), new File(folder.getAbsolute()));
log.warn(String.format("Move application support folder %s to Trash", previous));
try {
FileUtils.copyDirectory(new File(previous.getAbsolute()), new File(folder.getAbsolute()));
log.warn(String.format("Move application support folder %s to Trash", previous));
try {
final Trash trash = LocalTrashFactory.get();
trash.trash(previous);
final Symlink symlink = LocalSymlinkFactory.get();
symlink.symlink(previous, folder.getAbsolute());
}
catch(LocalAccessDeniedException e) {
log.warn(String.format("Failure cleaning up previous application support directory. %s", e.getMessage()));
}
final Trash trash = LocalTrashFactory.get();
trash.trash(previous);
final Symlink symlink = LocalSymlinkFactory.get();
symlink.symlink(previous, folder.getAbsolute());
}
catch(IOException e) {
log.warn(String.format("Failure migrating %s to security application group directory %s. %s", previous, folder, e.getMessage()));
catch(AccessDeniedException e) {
log.warn(String.format("Failure cleaning up previous application support directory. %s", e.getMessage()));
}
}
else {
log.debug(String.format("No previous application support folder found in %s", previous));
catch(IOException e) {
log.warn(String.format("Failure migrating %s to security application group directory %s. %s", previous, folder, e.getMessage()));
}
return folder;
}
catch(AccessDeniedException e) {
log.warn(String.format("Failure creating security application group directory. %s", e.getMessage()));
else {
log.debug(String.format("No previous application support folder found in %s", previous));
}
return folder;
}
}
log.warn("Missing support for security application groups. Default to application support directory");
Expand Down
7 changes: 7 additions & 0 deletions www/update/changelog.html
Expand Up @@ -57,6 +57,13 @@
explorer for Mac & Windows.
</p>

<p>
<a target="_blank" href="https://trac.cyberduck.io/milestone/7.9.2"><strong>Version 7.9.2</strong></a>
</p>
<ul>
<li><span class="label label-warning">Bugfix</span> Failure opening application with previous application support directory symbolic link (macOS)</li>
</ul>

<p>
<a target="_blank" href="https://trac.cyberduck.io/milestone/7.9.1"><strong>Version 7.9.1</strong></a>
</p>
Expand Down

0 comments on commit 2f26d4e

Please sign in to comment.