diff options
author | 2017-09-27 17:44:29 +0200 | |
---|---|---|
committer | 2017-09-27 17:44:29 +0200 | |
commit | 3b02e4a4dbe7bb89de83dcfbd7b79d569f3cecdb (patch) | |
tree | 63f342277a449c2d9cd8391932da79a7c0e0bae7 /Framework/hu.bme.mit.inf.dslreasoner.logic.model | |
parent | Transitive closure support for relation definitions in Alloy (diff) | |
download | VIATRA-Generator-3b02e4a4dbe7bb89de83dcfbd7b79d569f3cecdb.tar.gz VIATRA-Generator-3b02e4a4dbe7bb89de83dcfbd7b79d569f3cecdb.tar.zst VIATRA-Generator-3b02e4a4dbe7bb89de83dcfbd7b79d569f3cecdb.zip |
Listing all files in folder.
Diffstat (limited to 'Framework/hu.bme.mit.inf.dslreasoner.logic.model')
3 files changed, 18 insertions, 0 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/FileSystemWorkspace.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/FileSystemWorkspace.xtend index 6041fdbf..8efc1ce7 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/FileSystemWorkspace.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/FileSystemWorkspace.xtend | |||
@@ -71,4 +71,14 @@ class FileSystemWorkspace extends ReasonerWorkspace{ | |||
71 | override subWorkspace(String targetFolder, String prefix) { | 71 | override subWorkspace(String targetFolder, String prefix) { |
72 | return new FileSystemWorkspace(this.targetFolder + "/" + targetFolder, this.prefix + prefix) | 72 | return new FileSystemWorkspace(this.targetFolder + "/" + targetFolder, this.prefix + prefix) |
73 | } | 73 | } |
74 | |||
75 | override allFiles() { | ||
76 | val folder = new File(folderURI.toFileString) | ||
77 | if(folder.isDirectory) { | ||
78 | return folder.list | ||
79 | } else { | ||
80 | throw new IllegalArgumentException('''"«folderURI.toFileString»" is not a folder!''') | ||
81 | } | ||
82 | } | ||
83 | |||
74 | } \ No newline at end of file | 84 | } \ No newline at end of file |
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ProjectWorkspace.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ProjectWorkspace.xtend index 5703bd5a..a1560258 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ProjectWorkspace.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ProjectWorkspace.xtend | |||
@@ -102,4 +102,9 @@ class ProjectWorkspace extends ReasonerWorkspace{ | |||
102 | override subWorkspace(String targetFolder, String prefix) { | 102 | override subWorkspace(String targetFolder, String prefix) { |
103 | throw new UnsupportedOperationException("TODO: auto-generated method stub") | 103 | throw new UnsupportedOperationException("TODO: auto-generated method stub") |
104 | } | 104 | } |
105 | |||
106 | override allFiles() { | ||
107 | target.members.map[it.name] | ||
108 | } | ||
109 | |||
105 | } | 110 | } |
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ReasonerWorkspace.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ReasonerWorkspace.xtend index a7e3a48b..45cc7b3b 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ReasonerWorkspace.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/workspace/ReasonerWorkspace.xtend | |||
@@ -9,6 +9,7 @@ import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl | |||
9 | import org.eclipse.emf.ecore.resource.Resource | 9 | import org.eclipse.emf.ecore.resource.Resource |
10 | import java.io.ByteArrayOutputStream | 10 | import java.io.ByteArrayOutputStream |
11 | import java.io.IOException | 11 | import java.io.IOException |
12 | import java.util.List | ||
12 | 13 | ||
13 | abstract class ReasonerWorkspace{ | 14 | abstract class ReasonerWorkspace{ |
14 | 15 | ||
@@ -94,6 +95,8 @@ abstract class ReasonerWorkspace{ | |||
94 | // def void reactivate() | 95 | // def void reactivate() |
95 | // def void deactivate() | 96 | // def void deactivate() |
96 | 97 | ||
98 | def public List<String> allFiles(); | ||
99 | |||
97 | def public URI writeText(String name, CharSequence content); | 100 | def public URI writeText(String name, CharSequence content); |
98 | 101 | ||
99 | def public String readText(String name); | 102 | def public String readText(String name); |