Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pmx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
Show more breadcrumbs
Descartes Research
pmx
Commits
3fce85fe
Commit
3fce85fe
authored
7 years ago
by
Jürgen Walter
Browse files
Options
Downloads
Patches
Plain Diff
improved parsing of input directory
parent
3954e7e0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools.descartes.pmx.console/src/tools/descartes/pmx/console/PMXCommandLine.java
+34
-1
34 additions, 1 deletion
...nsole/src/tools/descartes/pmx/console/PMXCommandLine.java
with
34 additions
and
1 deletion
tools.descartes.pmx.console/src/tools/descartes/pmx/console/PMXCommandLine.java
+
34
−
1
View file @
3fce85fe
...
...
@@ -28,6 +28,7 @@ package tools.descartes.pmx.console;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
org.apache.commons.cli.BasicParser
;
...
...
@@ -240,7 +241,7 @@ public class PMXCommandLine {
String
inputDirCmd
=
commandLine
.
getOptionValue
(
CMD_LONG_OPT_INPUT_DIR
);
String
[]
inputDirs
=
inputDirCmd
.
split
(
";"
);
for
(
int
idx
=
0
;
idx
<
inputDirs
.
length
;
idx
++)
{
final
String
inputDir
=
inputDirs
[
idx
];
final
String
inputDir
=
inputDirs
[
idx
];
// + File.separator;
if
(
inputDir
==
null
)
{
log
.
info
(
"missing value for command line option '"
+
CMD_LONG_OPT_INPUT_DIR
+
"'"
);
System
.
exit
(
1
);
...
...
@@ -249,11 +250,43 @@ public class PMXCommandLine {
log
.
info
(
"\tcurrent:"
+
System
.
getProperty
(
"user.dir"
));
log
.
info
(
"\trequested:"
+
inputDir
);
System
.
exit
(
1
);
// or other exit code?
}
else
{
// inputDirs[idx] = inputDir;
if
(!
new
File
(
inputDir
).
getName
().
startsWith
(
"kieker-"
))
{
String
[]
recursive
=
recursiveKiekerFileSearch
(
inputDir
);
inputDirs
=
concat
(
inputDirs
,
recursive
);
for
(
String
sys
:
recursive
)
{
log
.
info
(
sys
);
}
}
// inputDirs[idx] = null;
}
}
return
inputDirs
;
}
private
String
[]
concat
(
String
[]
a
,
String
[]
b
)
{
int
aLen
=
a
.
length
;
int
bLen
=
b
.
length
;
String
[]
c
=
new
String
[
aLen
+
bLen
];
System
.
arraycopy
(
a
,
0
,
c
,
0
,
aLen
);
System
.
arraycopy
(
b
,
0
,
c
,
aLen
,
bLen
);
return
c
;
}
String
[]
recursiveKiekerFileSearch
(
String
inputDir
)
{
final
String
[]
inputDirs
;
// search subdirectories for folders "kieker- ..."
File
[]
fileArray
=
new
File
(
inputDir
).
listFiles
();
ArrayList
<
String
>
inputDirList
=
new
ArrayList
<
String
>();
for
(
int
i
=
0
;
i
<
fileArray
.
length
;
i
++)
{
if
(
fileArray
[
i
].
toString
().
contains
(
"kieker-"
))
{
inputDirList
.
add
(
fileArray
[
i
].
getAbsolutePath
()
+
File
.
separator
);
}
}
return
inputDirs
=
(
String
[])
inputDirList
.
toArray
(
new
String
[
inputDirList
.
size
()]);
}
private
static
FSReader
registerFSReader
(
IAnalysisController
analysisInstance
,
final
String
[]
kiekerTraceFile
)
{
final
String
[]
inputDirs
=
kiekerTraceFile
;
...
...
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