diff options
Diffstat (limited to 'Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace')
-rw-r--r-- | Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/URIBasedWorkspace.xtend | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/URIBasedWorkspace.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/URIBasedWorkspace.xtend new file mode 100644 index 00000000..37db4c3f --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/URIBasedWorkspace.xtend | |||
@@ -0,0 +1,65 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.workspace | ||
2 | |||
3 | import org.eclipse.emf.common.util.URI | ||
4 | |||
5 | class URIBasedWorkspace extends ReasonerWorkspace{ | ||
6 | val ReasonerWorkspace delegatedWorkspace; | ||
7 | |||
8 | new(String targetFolder, String prefix) { | ||
9 | super(targetFolder, prefix) | ||
10 | val targetFolderURI = URI.createURI(targetFolder) | ||
11 | if(targetFolderURI.isFile) { | ||
12 | delegatedWorkspace = new FileSystemWorkspace(targetFolder,prefix) | ||
13 | } else if(targetFolderURI.isPlatformResource){ | ||
14 | delegatedWorkspace = new ProjectWorkspace(targetFolder,prefix) | ||
15 | } else { | ||
16 | delegatedWorkspace = null | ||
17 | throw new UnsupportedOperationException('''Unknown URI: «targetFolder»''') | ||
18 | } | ||
19 | } | ||
20 | |||
21 | override subWorkspace(String targetFolder, String prefix) { | ||
22 | delegatedWorkspace.subWorkspace(targetFolder,prefix) | ||
23 | } | ||
24 | |||
25 | override getWorkspaceURI() { | ||
26 | delegatedWorkspace.getWorkspaceURI | ||
27 | } | ||
28 | |||
29 | override init() { | ||
30 | delegatedWorkspace.init | ||
31 | } | ||
32 | |||
33 | override clear() { | ||
34 | delegatedWorkspace.clear | ||
35 | } | ||
36 | |||
37 | override protected getURI(String name) { | ||
38 | delegatedWorkspace.getURI(name) | ||
39 | } | ||
40 | |||
41 | override getFile(String name) { | ||
42 | delegatedWorkspace.getFile(name) | ||
43 | } | ||
44 | |||
45 | override refreshFile(String name) { | ||
46 | delegatedWorkspace.refreshFile(name) | ||
47 | } | ||
48 | |||
49 | override protected renameFile(String name) { | ||
50 | delegatedWorkspace.renameFile(name) | ||
51 | } | ||
52 | |||
53 | override allFiles() { | ||
54 | delegatedWorkspace.allFiles | ||
55 | } | ||
56 | |||
57 | override writeText(String name, CharSequence content) { | ||
58 | delegatedWorkspace.writeText(name, content) | ||
59 | } | ||
60 | |||
61 | override readText(String name) { | ||
62 | delegatedWorkspace.readText(name) | ||
63 | } | ||
64 | |||
65 | } \ No newline at end of file | ||