Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Analyst WebApp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fidentis
Analyst WebApp
Commits
494ae8b2
There was an error fetching the commit references. Please try again later.
Commit
494ae8b2
authored
3 years ago
by
Daniel Schramm
Browse files
Options
Downloads
Patches
Plain Diff
Feature points import/export service made static; Inappropriate Optimal return value changed
parent
c0b5f22c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointImportExportService.java
+4
-7
4 additions, 7 deletions
...yst/feature/services/FeaturePointImportExportService.java
with
4 additions
and
7 deletions
MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointImportExportService.java
+
4
−
7
View file @
494ae8b2
...
...
@@ -15,14 +15,11 @@ import java.io.File;
import
java.io.FileNotFoundException
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.PrintWriter
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.stream.Stream
;
...
...
@@ -36,7 +33,7 @@ public class FeaturePointImportExportService {
private
static
final
String
COLUMN_DELIMETER
=
","
;
private
static
final
String
CODE_PREFIX_DELIMETER
=
" "
;
public
Optional
<
List
<
FeaturePoint
>
>
importFeaturePoints
(
String
path
,
String
fileName
)
{
public
static
List
<
FeaturePoint
>
importFeaturePoints
(
String
path
,
String
fileName
)
{
FileResourcesUtils
app
=
new
FileResourcesUtils
();
try
(
InputStreamReader
streamReader
=
new
InputStreamReader
(
app
.
getFileAsStream
(
path
,
fileName
),
StandardCharsets
.
UTF_8
);
...
...
@@ -66,7 +63,7 @@ public class FeaturePointImportExportService {
);
points
.
add
(
point
);
}
return
Optional
.
of
(
points
)
;
return
points
;
}
catch
(
IOException
e
)
{
throw
new
FeaturePointException
(
String
.
format
(
"Feature point cannot open file"
,
fileName
));
...
...
@@ -75,11 +72,11 @@ public class FeaturePointImportExportService {
}
}
private
String
getCode
(
String
str
)
{
private
static
String
getCode
(
String
str
)
{
return
str
.
substring
(
0
,
str
.
indexOf
(
CODE_PREFIX_DELIMETER
));
}
public
void
exportFeaturePoints
(
List
<
FeaturePoint
>
featurePointList
,
String
objectName
)
throws
FileNotFoundException
,
IOException
{
public
static
void
exportFeaturePoints
(
List
<
FeaturePoint
>
featurePointList
,
String
objectName
)
throws
FileNotFoundException
,
IOException
{
File
csvOutputFile
=
new
File
(
String
.
format
(
"%s_landmarks.csv"
,
objectName
));
// CSV is a normal text file, need a writer
try
(
BufferedWriter
bw
=
new
BufferedWriter
(
new
FileWriter
(
csvOutputFile
)))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment