Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
c5ee6128
Commit
c5ee6128
authored
14 years ago
by
cramakri
Browse files
Options
Downloads
Patches
Plain Diff
LMS-1483 Further work on the graph/plot framework.
SVN: 15482
parent
f7f54acd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractDataMergingReportingPlugin.java
+26
-14
26 additions, 14 deletions
.../plugins/standard/AbstractDataMergingReportingPlugin.java
with
26 additions
and
14 deletions
datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractDataMergingReportingPlugin.java
+
26
−
14
View file @
c5ee6128
...
@@ -120,39 +120,51 @@ public abstract class AbstractDataMergingReportingPlugin extends AbstractFileTab
...
@@ -120,39 +120,51 @@ public abstract class AbstractDataMergingReportingPlugin extends AbstractFileTab
protected
DatasetFileLines
loadFromDirectory
(
DatasetDescription
dataset
,
final
File
dir
)
protected
DatasetFileLines
loadFromDirectory
(
DatasetDescription
dataset
,
final
File
dir
)
throws
ParserException
,
ParsingException
,
IllegalArgumentException
,
throws
ParserException
,
ParsingException
,
IllegalArgumentException
,
IOExceptionUnchecked
IOExceptionUnchecked
{
List
<
File
>
datasetFilesToMerge
=
findMatchingFiles
(
dataset
,
dir
);
if
(
datasetFilesToMerge
.
size
()
!=
1
)
{
throw
UserFailureException
.
fromTemplate
(
"Directory with Data Set '%s' data ('%s') should contain exactly 1 file with data but %s files were found."
,
dataset
.
getDatasetCode
(),
dir
.
getAbsolutePath
(),
datasetFilesToMerge
.
size
());
}
else
{
return
loadFromFile
(
dataset
,
datasetFilesToMerge
.
get
(
0
));
}
}
/**
* Scan the specified directory to find files that match the dataset description.
*
* @throws IOExceptionUnchecked if a {@link IOException} has occurred.
*/
protected
List
<
File
>
findMatchingFiles
(
DatasetDescription
dataset
,
final
File
dir
)
throws
IllegalArgumentException
,
IOExceptionUnchecked
{
{
assert
dir
!=
null
:
"Given file must not be null"
;
assert
dir
!=
null
:
"Given file must not be null"
;
assert
dir
.
isDirectory
()
:
"Given file '"
+
dir
.
getAbsolutePath
()
+
"' is not a directory."
;
assert
dir
.
isDirectory
()
:
"Given file '"
+
dir
.
getAbsolutePath
()
+
"' is not a directory."
;
File
[]
datasetFiles
=
FileUtilities
.
listFiles
(
dir
);
File
[]
datasetFiles
=
FileUtilities
.
listFiles
(
dir
);
List
<
File
>
d
at
asetFilesToMerge
=
new
ArrayList
<
File
>();
List
<
File
>
m
at
chingFiles
=
new
ArrayList
<
File
>();
for
(
File
datasetFile
:
datasetFiles
)
for
(
File
datasetFile
:
datasetFiles
)
{
{
if
(
datasetFile
.
isDirectory
())
if
(
datasetFile
.
isDirectory
())
{
{
// recursively go down the directories
// recursively go down the directories
return
loadFromDirectory
(
dataset
,
datasetFile
);
return
findMatchingFiles
(
dataset
,
datasetFile
);
}
else
}
else
{
{
// exclude files with properties
// exclude files with properties
if
(
isFileExcluded
(
datasetFile
)
==
false
)
if
(
isFileExcluded
(
datasetFile
)
==
false
)
{
{
d
at
asetFilesToMerge
.
add
(
datasetFile
);
m
at
chingFiles
.
add
(
datasetFile
);
}
}
}
}
}
}
if
(
datasetFilesToMerge
.
size
()
!=
1
)
return
matchingFiles
;
{
throw
UserFailureException
.
fromTemplate
(
"Directory with Data Set '%s' data ('%s') should contain exactly 1 file with data but %s files were found."
,
dataset
.
getDatasetCode
(),
dir
.
getAbsolutePath
(),
datasetFilesToMerge
.
size
());
}
else
{
return
loadFromFile
(
dataset
,
datasetFilesToMerge
.
get
(
0
));
}
}
}
protected
boolean
isFileExcluded
(
File
file
)
protected
boolean
isFileExcluded
(
File
file
)
...
...
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