[sikuli] 321/385: minor refactoring
Gilles Filippini
pini at moszumanska.debian.org
Sun Jun 29 19:26:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
pini pushed a commit to tag upstream/1.1.0_beta1
in repository sikuli.
commit 64b006e350b1b939c652c4e0a870f57397bacad2
Author: Raimund Hocke <rmhdevelop at me.com>
Date: Thu Mar 6 06:16:49 2014 +0100
minor refactoring
---
.../main/java/org/sikuli/basics/FileManager.java | 22 ++++++++++++++++++++++
.../src/main/java/org/sikuli/basics/Settings.java | 22 +++-------------------
IDE/src/main/java/org/sikuli/ide/SikuliIDE.java | 2 +-
3 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/Basics/src/main/java/org/sikuli/basics/FileManager.java b/Basics/src/main/java/org/sikuli/basics/FileManager.java
index dbd131c..9f76a1d 100644
--- a/Basics/src/main/java/org/sikuli/basics/FileManager.java
+++ b/Basics/src/main/java/org/sikuli/basics/FileManager.java
@@ -894,6 +894,28 @@ public class FileManager {
}
}
+ /**
+ * INTERNAL USE
+ */
+ public static void cleanTemp() {
+ for (File f : new File(System.getProperty("java.io.tmpdir")).listFiles(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.contains("BridJExtractedLibraries")) {
+ return true;
+ }
+ if (name.toLowerCase().contains("sikuli")) {
+ return true;
+ }
+ return false;
+ }
+ })) {
+ Debug.log(4, "cleanTemp: " + f.getName());
+ FileManager.deleteFileOrFolder(f.getAbsolutePath());
+ }
+ FileManager.deleteFileOrFolder(Settings.BaseTempPath);
+ }
+
private static class FileFilterScript implements FilenameFilter {
private String _check;
public FileFilterScript(String check) {
diff --git a/Basics/src/main/java/org/sikuli/basics/Settings.java b/Basics/src/main/java/org/sikuli/basics/Settings.java
index 8259615..f7613cb 100644
--- a/Basics/src/main/java/org/sikuli/basics/Settings.java
+++ b/Basics/src/main/java/org/sikuli/basics/Settings.java
@@ -20,6 +20,9 @@ import java.util.Properties;
import java.util.ServiceLoader;
import java.util.prefs.Preferences;
+/**
+ * This is the container for all
+ */
public class Settings {
public static final int SikuliVersionMajor = 1;
@@ -149,25 +152,6 @@ public class Settings {
TypeEndings.put(EndingTypes.get(k), k);
}
}
-
- public static void cleanTemp() {
- for (File f : new File(System.getProperty("java.io.tmpdir")).listFiles(new FilenameFilter() {
- @Override
- public boolean accept(File dir, String name) {
- if (name.contains("BridJExtractedLibraries")) {
- return true;
- }
- if (name.toLowerCase().contains("sikuli")) {
- return true;
- }
- return false;
- }}))
- {
- Debug.log(4, "cleanTemp: " + f.getName());
- FileManager.deleteFileOrFolder(f.getAbsolutePath());
- }
- FileManager.deleteFileOrFolder(BaseTempPath);
- }
public static void initScriptingSupport() {
if (scriptRunner.size() == 0) {
diff --git a/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java b/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java
index f6df9b4..e356d03 100755
--- a/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java
+++ b/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java
@@ -175,7 +175,7 @@ public class SikuliIDE extends JFrame {
} catch (IOException ex) {
}
isRunning.delete();
- Settings.cleanTemp();
+ FileManager.cleanTemp();
}
});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/sikuli.git
More information about the pkg-java-commits
mailing list