Skip to content

Commit 7fab19a

Browse files
committed
Using File.pathSeparator instead of adding it to API...
Not sure what's wrong with me ;)
1 parent e2eb8ad commit 7fab19a

File tree

10 files changed

+22
-35
lines changed

10 files changed

+22
-35
lines changed

src/sk/tomsik68/mclauncher/api/common/IOperatingSystem.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,4 @@ public interface IOperatingSystem {
4040
*/
4141
public String getArchitecture();
4242

43-
/**
44-
*
45-
* @return System-specific char or string which will be used to separate
46-
* multiple paths
47-
*/
48-
public String getLibrarySeparator();
4943
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package sk.tomsik68.mclauncher.api.servers;
2+
3+
public class ServerPingPacketFactory {
4+
public ServerPingPacketFactory() {
5+
6+
}
7+
8+
public byte[] create() {
9+
return null;
10+
}
11+
}

src/sk/tomsik68/mclauncher/impl/common/LinuxOS.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,4 @@ public String getArchitecture() {
3737
return System.getProperty("sun.arch.data.model");
3838
}
3939

40-
@Override
41-
public String getLibrarySeparator() {
42-
return ":";
43-
}
4440
}

src/sk/tomsik68/mclauncher/impl/common/MacintoshOS.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,5 @@ public File getWorkingDirectory() {
3434
public String getArchitecture() {
3535
return System.getProperty("sun.arch.data.model");
3636
}
37-
@Override
38-
public String getLibrarySeparator() {
39-
return ":";
40-
}
4137

4238
}

src/sk/tomsik68/mclauncher/impl/common/SolarisOS.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,4 @@ public String getArchitecture() {
3737
return System.getProperty("sun.arch.data.model");
3838
}
3939

40-
@Override
41-
public String getLibrarySeparator() {
42-
return ":";
43-
}
4440
}

src/sk/tomsik68/mclauncher/impl/common/UnknownOS.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,5 @@ public File getWorkingDirectory() {
3636
public String getArchitecture() {
3737
return System.getProperty("sun.arch.data.model");
3838
}
39-
@Override
40-
public String getLibrarySeparator() {
41-
return ";";
42-
}
4339

4440
}

src/sk/tomsik68/mclauncher/impl/common/WindowsOS.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,4 @@ public File getWorkingDirectory() {
3939
public String getArchitecture() {
4040
return System.getProperty("sun.arch.data.model");
4141
}
42-
@Override
43-
public String getLibrarySeparator() {
44-
return ";";
45-
}
4642
}

src/sk/tomsik68/mclauncher/impl/versions/mcdownload/MCDownloadVersionInstaller.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,17 @@ public void install(IVersion v, IMinecraftInstance mc, IProgressMonitor progress
7575
updateResources(mc, version, progress);
7676
File jarDest = mc.getJarProvider().getVersionFile(version.getUniqueID());
7777
File jsonDest = new File(jarDest.getParentFile(), "info.json");
78-
if (!jsonDest.exists())
79-
FileUtils.writeFile(jsonDest, version.toJSON().toJSONString(JSONStyle.LT_COMPRESS));
80-
if (!jarDest.exists()) {
78+
// always overwrite json file
79+
// if (!jsonDest.exists())
80+
FileUtils.writeFile(jsonDest, version.toJSON().toJSONString(JSONStyle.LT_COMPRESS));
81+
// and jar file
82+
// if (!jarDest.exists())
8183
try {
8284
FileUtils.downloadFileWithProgress(MCLauncherAPI.URLS.NEW_JAR_DOWNLOAD_URL.replace("<VERSION>", version.getId()), jarDest, progress);
8385
} catch (Exception e) {
8486
e.printStackTrace();
8587
}
86-
}
88+
8789
notifyListeners(version);
8890
if (progress != null)
8991
progress.finish();

src/sk/tomsik68/mclauncher/impl/versions/mcdownload/MCDownloadVersionLauncher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public List<String> getLaunchCommand(ISession session, IMinecraftInstance mc, IS
9797
command.add("-Djava.library.path=" + nativesDir.getAbsolutePath());
9898
command.add("-cp");
9999
StringBuilder sb = new StringBuilder();
100-
final String LIBRARY_SEPARATOR = Platform.getCurrentPlatform().getLibrarySeparator();
100+
final String LIBRARY_SEPARATOR = File.pathSeparator;
101101
for (Library lib : version.getLibraries()) {
102102
if (lib.isCompatible())
103103
sb = sb.append(mc.getLibraryProvider().getLibraryFile(lib).getAbsolutePath()).append(LIBRARY_SEPARATOR);

src/sk/tomsik68/mclauncher/util/FilePathBuilder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
import java.io.File;
44

55
public class FilePathBuilder {
6-
private File file;
6+
private String path;
77

88
public FilePathBuilder(File start) {
9-
this.file = start;
9+
this.path = start.getAbsolutePath();
1010
}
1111

1212
public FilePathBuilder append(String s) {
13-
file = new File(file, s);
13+
path += File.separator + s;
1414
return this;
1515
}
1616
public File getResult(){
17-
return file;
17+
return new File(path);
1818
}
1919
}

0 commit comments

Comments
 (0)