Skip to content

Commit 5ec90fb

Browse files
committed
Installation of SwingJS Part 1
1 parent c7e7f42 commit 5ec90fb

38 files changed

+3866
-1446
lines changed

sources/net.sf.j2s.java.core/src/java/io/File.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
package java.io;
3030

3131
import java.io.IOException;
32+
import java.net.URI;
33+
import java.net.URISyntaxException;
3234
import java.security.AccessControlException;
3335
import java.util.ArrayList;
3436

@@ -622,16 +624,16 @@ public File getCanonicalFile() throws IOException {
622624
// return new File(canonPath, null);
623625
}
624626

625-
// private static String slashify(String path, boolean isDirectory) {
626-
// String p = path;
627-
// if (File.separatorChar != '/')
628-
// p = p.replace(File.separatorChar, '/');
629-
// if (!p.startsWith("/"))
630-
// p = "/" + p;
631-
// if (!p.endsWith("/") && isDirectory)
632-
// p = p + "/";
633-
// return p;
634-
// }
627+
private static String slashify(String path, boolean isDirectory) {
628+
String p = path;
629+
if (File.separatorChar != '/')
630+
p = p.replace(File.separatorChar, '/');
631+
if (!p.startsWith("/"))
632+
p = "/" + p;
633+
if (!p.endsWith("/") && isDirectory)
634+
p = p + "/";
635+
return p;
636+
}
635637

636638
// /**
637639
// * Converts this abstract pathname into a <code>file:</code> URL. The
@@ -693,6 +695,7 @@ public File getCanonicalFile() throws IOException {
693695
// * @see java.net.URI#toURL()
694696
// * @since 1.4
695697
// */
698+
// SwingJS TODO
696699
// public URI toURI() {
697700
// try {
698701
// File f = getAbsoluteFile();

0 commit comments

Comments
 (0)