Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
validator.genesys-pgr.org
Commits
5710ca31
Commit
5710ca31
authored
Dec 13, 2017
by
Matija Obreza
Browse files
Validator data folder root is /data and requires write permissions
parent
0e74d4d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
docker/Dockerfile
View file @
5710ca31
...
...
@@ -3,7 +3,7 @@ FROM jetty:9.4.5
LABEL
maintainer "Matija Obreza <matija.obreza@croptrust.org>"
ENV
USER=jetty \
APP_DATA=/data
/grin
\
APP_DATA=/data \
JETTY_BASE=/var/lib/jetty/ \
GENESYS_WAR='validator-web-*.war'
...
...
@@ -17,4 +17,4 @@ RUN mkdir -p $APP_DATA \
COPY
${GENESYS_WAR} ${JETTY_BASE}/webapps/validator.war
VOLUME
/data
/grin
VOLUME
/data
docker/validator.properties
View file @
5710ca31
# Path to directory
with extract GRIN-Taxonomy CAB
taxonomy.data
.path
=
/data
/grin
# Path to
writable
directory
for downloads
data.folder
.path
=
/data
src/main/java/org/genesys/taxonomy/checker/web/util/DownloaderData.java
View file @
5710ca31
...
...
@@ -57,7 +57,7 @@ public class DownloaderData {
File
downloadedFile
=
File
.
createTempFile
(
"temp-"
,
".zip"
);
if
(
files
.
length
==
0
)
{
LOG
.
warn
(
"
Data not provide
d in {}, starting download {}"
,
dataFolder
.
getAbsoluteFile
(),
downloadUrl
);
LOG
.
warn
(
"
No files {} foun
d in {}, starting download {}"
,
templateNameFileExist
,
dataFolder
.
getAbsoluteFile
(),
downloadUrl
);
download
(
downloadedFile
,
downloadUrl
);
if
(
unzip
)
{
...
...
@@ -134,26 +134,29 @@ public class DownloaderData {
ZipInputStream
zipIn
=
new
ZipInputStream
(
new
FileInputStream
(
zipFile
));
ZipEntry
entry
=
zipIn
.
getNextEntry
();
while
(
entry
!=
null
)
{
File
outputFile
;
String
filePath
;
File
target
;
if
(!
saveArchiveStructure
)
{
String
name
=
entry
.
getName
();
filePath
=
outputFolder
+
File
.
separator
+
name
.
substring
(
name
.
lastIndexOf
(
"/"
)
+
1
,
name
.
length
());
outputFile
=
new
File
(
filePath
);
target
=
new
File
(
outputFolder
,
name
.
substring
(
name
.
lastIndexOf
(
"/"
)
+
1
,
name
.
length
()));
}
else
{
filePath
=
outputFolder
+
File
.
separator
+
entry
.
getName
();
outputFile
=
new
File
(
filePath
);
outputFile
.
getParentFile
().
mkdirs
();
target
=
new
File
(
outputFolder
,
entry
.
getName
());
if
(!
target
.
getParentFile
().
exists
())
{
LOG
.
warn
(
"Making directories {}"
,
target
.
getParentFile
());
target
.
getParentFile
().
mkdirs
();
}
}
outputFile
.
createNewFile
();
if
(!
entry
.
isDirectory
())
{
extractFile
(
zipIn
,
outputFile
);
if
(!
entry
.
isDirectory
())
{
if
(!
target
.
exists
())
{
LOG
.
warn
(
"Creating file {}"
,
target
);
target
.
createNewFile
();
}
extractFile
(
zipIn
,
target
);
}
else
{
if
(
saveArchiveStructure
)
{
File
dir
=
new
File
(
filePath
);
LOG
.
warn
(
"Creating directory {}"
,
target
);
File
dir
=
target
;
dir
.
mkdir
();
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment