Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
CNNArch2X
Commits
f191f0c0
Commit
f191f0c0
authored
Nov 22, 2021
by
Cihad Kirhan
Browse files
Initialize file system before accessing file
parent
0e383f7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnnarch/generator/CNNTrainGenerator.java
View file @
f191f0c0
/* (c) https://github.com/MontiCore/monticore */
package
de.monticore.lang.monticar.cnnarch.generator
;
import
com.google.common.io.Resources
;
import
conflang._cocos.ConfLangCoCoChecker
;
import
conflang._cocos.ConfLangCocoFactory
;
import
conflang._symboltable.ConfLangLanguage
;
...
...
@@ -28,8 +29,15 @@ import java.io.IOException;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
java.nio.file.*
;
import
java.util.*
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.FileSystem
;
import
java.nio.file.FileSystems
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Optional
;
import
static
de
.
monticore
.
lang
.
monticar
.
cnnarch
.
generator
.
validation
.
Constants
.
ROOT_SCHEMA
;
import
static
de
.
monticore
.
lang
.
monticar
.
cnnarch
.
generator
.
validation
.
Constants
.
ROOT_SCHEMA_MODEL_PATH
;
...
...
@@ -50,11 +58,18 @@ public abstract class CNNTrainGenerator {
setInstanceName
(
rootModelName
);
URL
schemasResource
=
getClass
().
getClassLoader
().
getResource
(
ROOT_SCHEMA_MODEL_PATH
);
URL
url
=
getClass
().
getResource
(
ROOT_SCHEMA_MODEL_PATH
+
ROOT_SCHEMA
);
System
.
out
.
println
(
"urls:"
);
System
.
out
.
println
(
url
);
System
.
out
.
println
(
schemasResource
);
List
<
SchemaDefinitionSymbol
>
schemaDefinitionSymbols
;
try
{
String
content
=
Resources
.
toString
(
url
,
StandardCharsets
.
UTF_8
);
assert
schemasResource
!=
null
;
FileSystem
fileSystem
=
initFileSystem
(
schemasResource
.
toURI
());
Path
path
=
Paths
.
get
(
schemasResource
.
toURI
());
System
.
out
.
println
(
"fileSystem:"
);
System
.
out
.
println
(
fileSystem
);
Path
path
=
fileSystem
.
getPath
(
schemasResource
.
getPath
());
ModelPath
modelPath
=
new
ModelPath
(
path
);
SchemaDefinitionSymbol
schema
=
resolveSchemaDefinition
(
ROOT_SCHEMA
,
modelPath
);
SchemaLangCoCoChecker
checkerWithAllCoCos
=
SchemaLangCocoFactory
.
getCheckerWithAllCoCos
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment