forked from External/mage
Aded Random deck generation to Mage.Client start up dialog. Also now all cards on client can be fetched using CardsStorage.getAllCards() method.
This commit is contained in:
parent
791ce58b23
commit
2987d15b4e
10 changed files with 530 additions and 23 deletions
23
Mage.Client/src/main/java/mage/client/util/FileUtils.java
Normal file
23
Mage.Client/src/main/java/mage/client/util/FileUtils.java
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package mage.client.util;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class FileUtils {
|
||||
public static File getTempDir(String key) {
|
||||
String tmpDir = System.getProperty("java.io.tmpdir");
|
||||
String sep = System.getProperty("file.separator");
|
||||
|
||||
if (!tmpDir.endsWith(sep))
|
||||
tmpDir += sep;
|
||||
|
||||
tmpDir += key + "-" + java.util.UUID.randomUUID().toString();
|
||||
|
||||
File dir = new File(tmpDir);
|
||||
if (!dir.mkdirs()) {
|
||||
throw new RuntimeException("couldn't create temp directory " + tmpDir);
|
||||
}
|
||||
|
||||
return dir;
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue