Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dad
archive-format-converter
Commits
92dbe84b
Commit
92dbe84b
authored
Sep 16, 2021
by
marceteau
Browse files
refactoring commandLine et options
parent
dfea3f93
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/cines/pac/converter/ArchiveConverterMain.java
View file @
92dbe84b
...
...
@@ -89,6 +89,17 @@ public class ArchiveConverterMain {
public
ArchiveConverterMain
(
String
[]
args
)
throws
ParseException
{
CommandLineParser
parser
=
new
BasicParser
();
Options
options
=
new
Options
();
addWantedOptions
(
options
);
CommandLine
commandLine
=
parser
.
parse
(
options
,
args
);
parseCommandLine
(
options
,
commandLine
);
}
/**
* @param options
*/
private
void
addWantedOptions
(
Options
options
)
{
options
.
addOption
(
"f"
,
"input-format"
,
true
,
"Précise le formalisme d'entrée : sip, aip ou seda1"
);
options
.
addOption
(
"m"
,
"only-manifest"
,
false
,
"Si présente, ne fais que la conversion des manifests"
);
options
.
addOption
(
"d"
,
"input-folder"
,
true
,
"Chemin du répertoire dans lequel se trouve les archives pour un traitement par lot. Non récursif."
);
...
...
@@ -99,10 +110,13 @@ public class ArchiveConverterMain {
options
.
addOption
(
"e"
,
"error-dir"
,
true
,
"Répertoire où seront placés les paquets en erreur"
);
options
.
addOption
(
"l"
,
"language-error-dir"
,
true
,
"Répertoire où seront placés les paquets en erreur à cause de l'attribut language"
);
options
.
addOption
(
"p"
,
"plan-classement"
,
true
,
"Chemin du fichier csv indiquant le plan de classement"
);
}
CommandLine
commandLine
=
parser
.
parse
(
options
,
args
);
/**
* @param options
* @param commandLine
*/
private
void
parseCommandLine
(
Options
options
,
CommandLine
commandLine
)
{
if
(
commandLine
.
hasOption
(
"a"
))
{
agency
=
commandLine
.
getOptionValue
(
"a"
)
;
}
else
{
...
...
@@ -195,6 +209,7 @@ public class ArchiveConverterMain {
}
}
private
void
manageLanguageRejectException
(
DuplicateLanguageException
e
)
{
try
{
logger
.
error
(
e
.
getMessage
());
...
...
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