-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessing_Client.java
More file actions
50 lines (39 loc) · 926 Bytes
/
Processing_Client.java
File metadata and controls
50 lines (39 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package SpeedClient;
import java.io.*;
import javax.swing.JOptionPane;
/**
*
* @author Jochen
*
*/
public class Processing_Client {
// Detects which operating system SpeedMatch is running on
public static String detectOS() {
String os = System.getProperty("os.name").toLowerCase();
if(os.contains("win")) {
return "Windows";
}
else if(os.contains("nix")||os.contains("nux")||os.contains("mac")) {
return "Unix";
}
else {
return "other";
}
}
// Returns the working directory of the program in system-specific formatting
public static String getHomeDir() {
char sep = '/';
if(detectOS().equals("Windows")) {
sep = '\\';
}
return System.getProperty("user.home")+ sep+"SpeedMatch"+sep;
}
// Get system-specific Line separator
public static String getLineSep() {
String newline = "\n";
if(detectOS().equals("Windows")) {
newline = "\r\n";
}
return newline;
}
}