Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
riseclipse-validator-ocl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
RiseClipseGroup
riseclipse-validator-ocl
Merge requests
!8
Resolve "OCLValidator should take care of file systems differences"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "OCLValidator should take care of file systems differences"
9-oclvalidator-should-take-care-of-file-systems-differences
into
master
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Dominique Marcadet
requested to merge
9-oclvalidator-should-take-care-of-file-systems-differences
into
master
6 years ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
Closes
#9 (closed)
Edited
6 years ago
by
Dominique Marcadet
👍
0
👎
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
56589b16
1 commit,
6 years ago
1 file
+
23
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
fr.centralesupelec.edf.riseclipse.validation.ocl/src/fr/centralesupelec/edf/riseclipse/validation/ocl/OCLValidator.java
+
23
−
1
Options
@@ -19,6 +19,7 @@
package
fr.centralesupelec.edf.riseclipse.validation.ocl
;
import
java.io.BufferedWriter
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
@@ -93,11 +94,32 @@ public class OCLValidator {
// }
public
boolean
addOCLDocument
(
String
oclFileName
,
IRiseClipseConsole
console
)
{
return
addOCLDocument
(
new
File
(
oclFileName
),
console
);
}
public
boolean
addOCLDocument
(
File
oclFile
,
IRiseClipseConsole
console
)
{
if
(
!
oclFile
.
exists
()
)
{
console
.
error
(
oclFile
+
" does not exist"
);
return
false
;
}
if
(
!
oclFile
.
isFile
()
)
{
console
.
error
(
oclFile
+
" is not a file"
);
return
false
;
}
if
(
!
oclFile
.
canRead
()
)
{
console
.
error
(
oclFile
+
" cannot be read"
);
return
false
;
}
//Path path = FileSystems.getDefault().getPath( oclFileName ).toAbsolutePath();
String
path
=
oclFile
.
getAbsolutePath
();
// Take care of Windows paths
if
(
path
.
charAt
(
0
)
!=
'/'
)
{
path
=
"/"
+
path
.
replace
(
'\\'
,
'/'
);
}
try
{
BufferedWriter
o
=
Files
.
newBufferedWriter
(
oclTempFile
,
StandardOpenOption
.
APPEND
);
//o.write( "import \'" + path + "\'\n" );
o
.
write
(
"import \'
"
+
oclFileName
+
"\'\n"
);
o
.
write
(
"import \'
file:"
+
path
+
"\'\n"
);
o
.
close
();
}
catch
(
IOException
e
)
{
Loading