#1

parent b5e171c1
mvn package -Dmaven.test.skip && cd target/ && unzip ids.server-1.8.0-patched-distro.zip && cd ids.server && cp ../../*properties . && python setup install && cd .. && cd ..
# General properties
icat.url = https://icat.esrf.fr
plugin.zipMapper.class = org.icatproject.ids.storage.esrf.ZipMapper
# Properties for main storage
plugin.main.class = org.icatproject.ids.storage.esrf.MainFileStorage
plugin.main.dir = /data/icat/main
plugin.main.icat.url = https://icat.esrf.fr
plugin.main.icat.user = admin
plugin.main.icat.password = 1dM!n
plugin.main.icat.auth = db
cache.dir = /data/icat/cache
# Ids server settings
preparedCount = 10000
processQueueIntervalSeconds = 5
rootUserNames = root
sizeCheckIntervalSeconds = 60
reader = db username admin password 1dM!n
!readOnly = true
maxIdsInQuery = 1000
# Properties for archive storage
plugin.archive.class = org.icatproject.ids.storage.esrf.ArchiveFileStorage
plugin.archive.dir = /data/iti/restored
plugin.archive.queue_out_tmp = /data/iti/outq/tmp
plugin.archive.queue_out_wait = /data/iti/outq/wait
plugin.archive.restoration_time_out = 86400
writeDelaySeconds = 60
startArchivingLevel1024bytes = 5000000
stopArchivingLevel1024bytes = 4000000
storageUnit = dataset
tidyBlockSize = 500
# File checking properties
filesCheck.parallelCount = 0
filesCheck.gapSeconds = 5
filesCheck.lastIdFile = /tmp/ids/lastIdFile
filesCheck.errorLog = /tmp/ids/errorLog
# Link properties
linkLifetimeSeconds = 3600
# JMS Logging
log.list = READ WRITE INFO LINK MIGRATE PREPARE
# JMS - uncomment and edit if needed
!jms.topicConnectionFactory = java:comp/DefaultJMSConnectionFactory
# Glassfish
secure = false
container = Glassfish
home = /opt2/glassfish4
port = 4848
# Any libraries needed (space separated list of jars in domain's lib/applibs
libraries=ids.storage_esrf-1.8.0.jar
......@@ -217,22 +217,25 @@ public class IdsBean {
String entryName = zipMapper.getFullEntryName(dsInfo, dfInfo);
InputStream stream = null;
try {
zos.putNextEntry(new ZipEntry(entryName));
if (new File( dfInfo.getDfLocation()).exists()){
//System.out.println("Main path: " + mainStorage.getPath(dfInfo.getDfLocation(), dfInfo.getCreateId(), dfInfo.getModId()));
if (new File( dfInfo.getDfLocation()).exists() || mainStorage.exists(dsInfo)){
zos.putNextEntry(new ZipEntry(entryName));
stream = mainStorage.get(dfInfo.getDfLocation(), dfInfo.getCreateId(), dfInfo.getModId());
int length;
while ((length = stream.read(bytes)) >= 0) {
zos.write(bytes, 0, length);
}
zos.closeEntry();
}
else{
System.out.println("File does not exist: " + dfInfo.getDfLocation());
missingFiles.add(dfInfo.getDfLocation());
}
} catch (ZipException e) {
e.printStackTrace();
logger.debug("Skipped duplicate");
}
zos.closeEntry();
if (stream != null) {
stream.close();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment