Skip to content

Commit cc1fe60

Browse files
matmat
authored andcommitted
extracted file monitoring to separate project
1 parent 8580537 commit cc1fe60

10 files changed

Lines changed: 11 additions & 297 deletions

File tree

‎koans-lib/.classpath‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
<classpath>
33
<classpathentry kind="src" path="src"/>
44
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5+
<classpathentry combineaccessrules="false" kind="src" path="/file-monitor"/>
56
<classpathentry kind="output" path="bin"/>
67
</classpath>

‎koans-lib/src/com/sandwich/koan/runner/AppLauncher.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.sandwich.koan.runner;
22

3+
import java.io.File;
34
import java.util.Map;
45

56
import com.sandwich.koan.ApplicationSettings;
@@ -17,7 +18,9 @@ public class AppLauncher {
1718
public static void main(final String... args) throws Throwable {
1819
Map<ArgumentType, CommandLineArgument> argsMap = new CommandLineArgumentBuilder(args);
1920
if(argsMap.containsKey(ArgumentType.RUN_KOANS)){
20-
FileMonitorFactory.getInstance(DirectoryManager.getProdMainDir())
21+
FileMonitorFactory.getInstance(
22+
new File(DirectoryManager.getProdMainDir()),
23+
new File(DirectoryManager.getDataFile()))
2124
.addFileSavedListener(new KoanFileCompileAndRunListener(argsMap));
2225
}
2326
new CommandLineArgumentRunner(argsMap).run();

‎koans-lib/src/com/sandwich/util/io/DataFileHelper.java‎

Lines changed: 0 additions & 76 deletions
This file was deleted.

‎koans-lib/src/com/sandwich/util/io/DynamicClassLoader.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class DynamicClassLoader extends ClassLoader {
1818
private static Map<URL, Class<?>> classesByLocation = new HashMap<URL, Class<?>>();
1919
private static Map<Class<?>, URL> locationByClass = new HashMap<Class<?>, URL>();
2020
private final FileMonitor fileMonitor = FileMonitorFactory.getInstance(
21-
DirectoryManager.getProdMainDir());
21+
new File(DirectoryManager.getProdMainDir()), new File(DirectoryManager.getDataFile()));
2222

2323
public DynamicClassLoader(){
2424
this(ClassLoader.getSystemClassLoader());

‎koans-lib/src/com/sandwich/util/io/FileAction.java‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎koans-lib/src/com/sandwich/util/io/FileListener.java‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎koans-lib/src/com/sandwich/util/io/FileMonitor.java‎

Lines changed: 0 additions & 94 deletions
This file was deleted.

‎koans-lib/src/com/sandwich/util/io/FileMonitorFactory.java‎

Lines changed: 0 additions & 78 deletions
This file was deleted.

‎koans-lib/src/com/sandwich/util/io/directories/DirectoryManager.java‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ public static String getProjectI18nDir(){
7272
}
7373

7474
public static String getProjectDataSourceDir() {
75-
return injectFileSystemSeparators( getDataDir(),
76-
instance.getSourceDir());
75+
return injectFileSystemSeparators(getDataDir(), instance.getSourceDir());
76+
}
77+
78+
public static String getDataFile() {
79+
return injectFileSystemSeparators(getDataDir(), "file_hashes.dat");
7780
}
7881

7982
/**

‎koans-tests/test/com/sandwich/util/io/FileMonitorTest.java‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)