Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
subhra74 committed Oct 20, 2019
1 parent 0fceb63 commit b5509b7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -112,6 +113,7 @@ public synchronized void delete(FileInfo f) throws Exception {

@Override
public void mkdir(String path) throws Exception {
System.out.println("Creating folder: " + path);
new File(path).mkdirs();
}

Expand Down Expand Up @@ -203,7 +205,7 @@ public String getProtocol() {
*/
@Override
public void createFile(String path) throws Exception {

Files.createFile(Paths.get(path));
}

public void createLink(String src, String dst, boolean hardLink)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,18 @@ private void createBuitinItems1(int selectionCount, JPopupMenu popup, FileInfo[]
|| selectedFiles[0].getType() == FileType.FileLink) {
popup.add(mOpen);
}
if (selectedFiles[0].getType() == FileType.Directory
|| selectedFiles[0].getType() == FileType.DirLink) {
popup.add(mOpenInNewTab);
}
popup.add(mRename);
}

if (selectedFiles[0].getType() == FileType.Directory
|| selectedFiles[0].getType() == FileType.DirLink) {
popup.add(mOpenInNewTab);
}

if (selectionCount == 1) {
popup.add(mRename);
}

// if (selectionCount == 1) {
// popup.add(mRename);
// }

// if (selectionCount > 0) {
// popup.add(mCopy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import snowflake.common.FileInfo;
import snowflake.common.FileType;
import snowflake.common.local.files.LocalFileSystem;
import snowflake.common.ssh.files.SshFileSystem;
import snowflake.components.files.FileComponentHolder;
import snowflake.components.files.browser.FileBrowser;
Expand Down Expand Up @@ -148,8 +147,7 @@ private void createBuitinItems1(int selectionCount, JPopupMenu popup, FileInfo[]
}

// if (selectionCount > 0) {
// popup.add(mCopy);
// popup.add(mCut);
// popup.add(mDelete);
// }
}

Expand Down Expand Up @@ -194,7 +192,7 @@ private void delete(FileInfo[] selectedFiles) {
fileBrowser.disableUi();
for (FileInfo f : selectedFiles) {
try {
new LocalFileSystem().delete(f);
fs.delete(f);
} catch (Exception e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ private boolean isSingleArchive(String archivePath) {
archivePath = archivePath.toLowerCase(Locale.ENGLISH);
for (String key : extractCommands.keySet()) {
if (archivePath.endsWith(key) && (key.equals(".xz") || key.equals(".gz") || key.equals(".bz2"))) {
return true;
if (!(archivePath.endsWith(".tar.xz")
|| archivePath.endsWith(".tar.gz")
|| archivePath.endsWith(".tar.bz2"))) {
return true;
}
}
}
return false;
Expand Down

0 comments on commit b5509b7

Please sign in to comment.