Update AppID documentation
This commit is contained in:
parent
956364b449
commit
e4b34d51d9
|
@ -8,8 +8,8 @@ _A platform-independent serial port access library for Java._
|
|||
For usage examples, please refer to the [Usage wiki](https://github.com/Fazecast/jSerialComm/wiki/Usage-Examples).
|
||||
|
||||
If you intend to use the library in multiple applications simultaneously, please make sure
|
||||
to set ```fazecast.jSerialComm.appid``` property before accessing the SerialPort class so that
|
||||
applications don't accidentally delete each others temporary files during boot-up:
|
||||
to set the ```fazecast.jSerialComm.appid``` property before accessing the SerialPort class
|
||||
so that applications don't accidentally delete each others' temporary files during boot-up:
|
||||
```
|
||||
System.setProperty("fazecast.jSerialComm.appid", "YOUR_APPLICATION_IDENTIFIER")
|
||||
```
|
||||
|
|
|
@ -51,9 +51,7 @@ public final class SerialPort
|
|||
{
|
||||
// Static initializer loads correct native library for this machine
|
||||
private static final String versionString = "2.7.0";
|
||||
// Used to distinguish multiple processes running this lib
|
||||
private static final String TMPDIR_APPID_PROPERTY = "fazecast.jSerialComm.appid";
|
||||
|
||||
private static final String tmpdirAppIdProperty = "fazecast.jSerialComm.appid";
|
||||
private static volatile boolean isAndroid = false;
|
||||
private static volatile boolean isUnixBased = false;
|
||||
private static volatile boolean isWindows = false;
|
||||
|
@ -66,8 +64,8 @@ public final class SerialPort
|
|||
if ((tempFileDirectory.charAt(tempFileDirectory.length()-1) != '\\') && (tempFileDirectory.charAt(tempFileDirectory.length()-1) != '/'))
|
||||
tempFileDirectory += "/";
|
||||
|
||||
// Make sure to use appId to separate tmpdir directories if library is used by multiple modules, so they don't erase each others folders accidentally.
|
||||
String appId = System.getProperty(TMPDIR_APPID_PROPERTY, "");
|
||||
// Make sure to use appId to separate tmpdir directories if library is used by multiple modules so they don't erase each others' folders
|
||||
String appId = System.getProperty(tmpdirAppIdProperty, "");
|
||||
tempFileDirectory += "jSerialComm/";
|
||||
if (!appId.isEmpty()) {
|
||||
tempFileDirectory += appId + (!appId.endsWith("/") ? "/" : "");
|
||||
|
|
Loading…
Reference in New Issue