This commit is contained in:
Alessandro Ferro 2023-08-10 14:55:37 +02:00
parent 0ea57a374a
commit 36f42f62d0
2 changed files with 11 additions and 12 deletions

View File

@ -420,11 +420,14 @@ public class DesktopController {
}
/**
* Checks if the specified path is readable by the current user
* @return true if readable, false otherwise
* @deprecated This method is deprecated. Catch SftpException and look for
* "Permission denied" instead. This prevents unnecessary
* overhead
*/
public boolean isReadable(String path) {
// Create the construct [ -r "/path" ] && echo 1 || echo 0
StringBuilder command = new StringBuilder();
command.append("[ -r \"");
command.append(path.equals("~")
@ -435,10 +438,13 @@ public class DesktopController {
}
/**
* Checks if the specified path is writable by the current user
* @return true if writable, false otherwise
* @deprecated This method is deprecated. Catch SftpException and look for
* "Permission denied" instead
*/
public boolean isWriteable(String path) {
// Create the construct [ -w "/path" ] && echo 1 || echo 0
StringBuilder command = new StringBuilder();
command.append("[ -w \"");
command.append(path.equals("~")

View File

@ -674,9 +674,7 @@ public class Desktop extends JFrame implements IDesktopFrame {
return;
}
drawComponentsForDirectory(
controller.getCurrentWorkingDirectory()); // TODO
// optimize
// this
controller.getCurrentWorkingDirectory());
}
// Hover on
@ -791,12 +789,7 @@ public class Desktop extends JFrame implements IDesktopFrame {
return;
}
drawComponentsForDirectory(
controller.getCurrentWorkingDirectory()); // TODO:
// avoid
// a
// complete
// desktop
// reload
controller.getCurrentWorkingDirectory());
}
});
@ -822,7 +815,7 @@ public class Desktop extends JFrame implements IDesktopFrame {
deleteBtn = new JButton();
deleteBtn.setBorderPainted(false);
deleteBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border);
deleteBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border;
deleteBtn.setToolTipText("Delete");
try {
deleteBtn.setIcon(new ImageIcon(ImageIO
@ -973,7 +966,7 @@ public class Desktop extends JFrame implements IDesktopFrame {
JButton queueBtn = new JButton();
queueBtn.setBorderPainted(false);
queueBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border);
queueBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border;
queueBtn.setToolTipText("Queue");
try {
queueBtn.setIcon(new ImageIcon(ImageIO
@ -1032,7 +1025,7 @@ public class Desktop extends JFrame implements IDesktopFrame {
JButton goToBtn = new JButton();
goToBtn.setBorderPainted(false);
goToBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border);
goToBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border
goToBtn.setToolTipText("Go");
try {
goToBtn.setIcon(new ImageIcon(ImageIO