diff --git a/remotesync-api/pom.xml b/remotesync-api/pom.xml
index 96f5229..0b5c2c9 100644
--- a/remotesync-api/pom.xml
+++ b/remotesync-api/pom.xml
@@ -104,6 +104,8 @@
org.piwigo.remotesync.api.Main
+ true
+ true
@@ -112,12 +114,17 @@
maven-assembly-plugin
2.4
+ remotesync
+ ../remotesync/target/
+ false
jar-with-dependencies
org.piwigo.remotesync.api.Main
+ true
+ true
@@ -136,7 +143,7 @@
piwigo
remotesync
- 0.0.7
+ 0.0.8
../remotesync
diff --git a/remotesync-api/src/main/java/org/piwigo/remotesync/api/AbstractMain.java b/remotesync-api/src/main/java/org/piwigo/remotesync/api/AbstractMain.java
index e378cb2..84d2f05 100644
--- a/remotesync-api/src/main/java/org/piwigo/remotesync/api/AbstractMain.java
+++ b/remotesync-api/src/main/java/org/piwigo/remotesync/api/AbstractMain.java
@@ -38,21 +38,24 @@ protected void run(String[] args) {
createConfiguration(parsedSyncConfiguration);
if (help) {
- System.out.println("Piwigo Remote Sync : java -jar remotesync.jar");
- cmdLineParser.printUsage(System.out);
+ help(cmdLineParser);
return;
}
start();
} catch (CmdLineException e) {
System.err.println(e.getMessage());
- System.err.println("Piwigo Remote Sync : java -jar remotesync.jar");
- cmdLineParser.printUsage(System.err);
- System.err.println();
- System.err.println(" Example: java -jar remotesync.jar" + cmdLineParser.printExample(OptionHandlerFilter.ALL));
+ System.err.flush();
+ help(cmdLineParser);
}
}
+ protected void help(CmdLineParser cmdLineParser) {
+ System.out.println("Piwigo Remote Sync (version " + getClass().getPackage().getImplementationVersion() + ") : java -jar remotesync.jar");
+ cmdLineParser.printUsage(System.out);
+ System.out.println("Example: java -jar remotesync.jar" + cmdLineParser.printExample(OptionHandlerFilter.ALL));
+ }
+
protected abstract void start();
@Option(name = "-debug", usage = "enable debug messages")
diff --git a/remotesync-api/src/main/java/org/piwigo/remotesync/api/Constants.java b/remotesync-api/src/main/java/org/piwigo/remotesync/api/Constants.java
index a400f59..90bbe1d 100644
--- a/remotesync-api/src/main/java/org/piwigo/remotesync/api/Constants.java
+++ b/remotesync-api/src/main/java/org/piwigo/remotesync/api/Constants.java
@@ -17,6 +17,7 @@
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.AbstractFileFilter;
import org.apache.commons.io.filefilter.IOFileFilter;
+import org.piwigo.remotesync.api.conf.ConfigurationUtil;
public class Constants {
@@ -41,4 +42,10 @@ public boolean accept(File file) {
}
+ public static final String DIRECTORY_DEFAULT = ConfigurationUtil.INSTANCE.getUserCurrentDirectory().getAbsolutePath();
+
+ public static final String CHUNK_SIZE_DEFAULT = "500";
+
+ public static final int CHUNK_SIZE_INT_DEFAULT = Integer.parseInt(CHUNK_SIZE_DEFAULT);
+
}
diff --git a/remotesync-api/src/main/java/org/piwigo/remotesync/api/cache/LegacyCache.java b/remotesync-api/src/main/java/org/piwigo/remotesync/api/cache/LegacyCache.java
index df47a9b..bfe20b4 100644
--- a/remotesync-api/src/main/java/org/piwigo/remotesync/api/cache/LegacyCache.java
+++ b/remotesync-api/src/main/java/org/piwigo/remotesync/api/cache/LegacyCache.java
@@ -106,24 +106,32 @@ public LegacyCache parseFile() {
public LegacyCache parseContent(String content) {
Matcher matcher = ALBUM_PATTERN.matcher(content);
- if (matcher.find()) {
- albumCacheElement = new AlbumCacheElement();
- albumCacheElement.url = matcher.group(1);
- albumCacheElement.id = Integer.parseInt(matcher.group(2));
+ while (matcher.find()) {
+ if (isSameUrl(matcher.group(1))) {
+ albumCacheElement = new AlbumCacheElement();
+ albumCacheElement.url = matcher.group(1);
+ albumCacheElement.id = Integer.parseInt(matcher.group(2));
+ }
}
matcher = IMAGE_PATTERN.matcher(content);
while (matcher.find()) {
- ImageCacheElement imageCacheElement = new ImageCacheElement();
- imageCacheElement.url = matcher.group(1);
- imageCacheElement.filePathMD5 = matcher.group(2);
- imageCacheElement.id = Integer.parseInt(matcher.group(3));
- imagesCache.add(imageCacheElement);
+ if (isSameUrl(matcher.group(1))) {
+ ImageCacheElement imageCacheElement = new ImageCacheElement();
+ imageCacheElement.url = matcher.group(1);
+ imageCacheElement.filePathMD5 = matcher.group(2);
+ imageCacheElement.id = Integer.parseInt(matcher.group(3));
+ imagesCache.add(imageCacheElement);
+ }
}
return this;
}
+ public boolean isSameUrl(String otherUrl) {
+ return url.replaceAll("https?", "").equals(otherUrl.replaceAll("https?", ""));
+ }
+
protected void writeToFile(ILegacyCacheElement abstractCacheElement) {
try {
FileUtils.writeStringToFile(cacheFile, abstractCacheElement.writeToString() + "\n", true);
diff --git a/remotesync-api/src/main/java/org/piwigo/remotesync/api/client/AbstractClient.java b/remotesync-api/src/main/java/org/piwigo/remotesync/api/client/AbstractClient.java
index 349a848..0590982 100644
--- a/remotesync-api/src/main/java/org/piwigo/remotesync/api/client/AbstractClient.java
+++ b/remotesync-api/src/main/java/org/piwigo/remotesync/api/client/AbstractClient.java
@@ -22,13 +22,13 @@
public abstract class AbstractClient implements IClient {
@Override
- public final T sendRequest(AbstractRequest request) throws ClientServerException {
+ public T sendRequest(AbstractRequest request) throws ClientServerException {
return doSendRequest(request);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
- public final ComposedResponse sendRequest(ComposedRequest composedRequest) throws ClientServerException {
+ public ComposedResponse sendRequest(ComposedRequest composedRequest) throws ClientServerException {
ComposedResponse composedResponse = new ComposedResponse();
Iterator> iterator = composedRequest.iterator();
while (iterator.hasNext()) {
diff --git a/remotesync-api/src/main/java/org/piwigo/remotesync/api/client/WSClient.java b/remotesync-api/src/main/java/org/piwigo/remotesync/api/client/WSClient.java
index 41b0381..c5700c7 100644
--- a/remotesync-api/src/main/java/org/piwigo/remotesync/api/client/WSClient.java
+++ b/remotesync-api/src/main/java/org/piwigo/remotesync/api/client/WSClient.java
@@ -18,7 +18,6 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.NotImplementedException;
import org.apache.http.HttpHost;
-import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
@@ -36,7 +35,10 @@
import org.piwigo.remotesync.api.exception.ClientServerException;
import org.piwigo.remotesync.api.exception.ServerException;
import org.piwigo.remotesync.api.request.AbstractRequest;
+import org.piwigo.remotesync.api.request.ComposedRequest;
+import org.piwigo.remotesync.api.request.IChunkable;
import org.piwigo.remotesync.api.response.BasicResponse;
+import org.piwigo.remotesync.api.response.ComposedResponse;
import org.piwigo.remotesync.api.response.ServerResponse;
import org.piwigo.remotesync.api.xml.PersisterFactory;
import org.slf4j.Logger;
@@ -48,8 +50,6 @@
* System.out.println(response.getStatusLine().getStatusCode());
* System.out.println(response.getStatusLine().getReasonPhrase());
* System.out.println(response.getStatusLine().toString());
- *
- * TODO handle proxy
*/
public class WSClient extends AbstractClient {
@@ -63,34 +63,69 @@ public WSClient(IClientConfiguration clientConfiguration) {
this.clientConfiguration = clientConfiguration;
}
- @SuppressWarnings("unchecked")
+ @Override
+ public T sendRequest(AbstractRequest request) throws ClientServerException {
+ handleChunkable(request);
+ return super.sendRequest(request);
+ }
+
+ @Override
+ public ComposedResponse sendRequest(ComposedRequest composedRequest) throws ClientServerException {
+ handleChunkable(composedRequest);
+ return super.sendRequest(composedRequest);
+ }
+
+ protected void handleChunkable(AbstractRequest request) {
+ if (request instanceof IChunkable)
+ ((IChunkable) request).setChunkSize(clientConfiguration.getChunkSize());
+ }
+
@Override
protected T doSendRequest(AbstractRequest request) throws ClientServerException {
checkRequestAuthorization(request);
- if (httpClient == null) {
- HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
+ String content = getXmlResponse(request);
- if (clientConfiguration.getUsesProxy()) {
- String proxyUrl = clientConfiguration.getProxyUrl();
- int proxyPort = clientConfiguration.getProxyPort();
-
- String proxyUsername = clientConfiguration.getProxyUsername();
- String proxyPassword = clientConfiguration.getProxyPassword();
+ // basic parsing
+ ServerResponse errorResponse = parseResponse(content, ServerResponse.class, false);
+
+ if ("ok".equals(errorResponse.status)) {
+ // complete parsing
+ T response = parseResponse(content, request.getReturnType(), true);
+ response.setXmlContent(content);
+ return response;
+ } else if ("fail".equals(errorResponse.status)) {
+ logger.debug(content);
+ throw new ServerException(errorResponse.error.toString());
+ } else {
+ throw new NotImplementedException();
+ }
+ }
- if (proxyUsername != null && proxyUsername.length() > 0 && proxyPassword != null && proxyPassword.length() > 0) {
- CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
- credentialsProvider.setCredentials(new AuthScope(proxyUrl, proxyPort), new UsernamePasswordCredentials(proxyUsername, proxyPassword));
- httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
- }
+ protected String getXmlResponse(AbstractRequest request) throws ClientException, ServerException {
+ CloseableHttpResponse httpResponse = null;
+
+ try {
+ httpResponse = getHttpResponse(request);
- HttpHost proxy = new HttpHost(proxyUrl, proxyPort);
- requestConfig = RequestConfig.custom().setProxy(proxy).build();
+ if (httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK)
+ throw new ServerException(httpResponse.getStatusLine().getReasonPhrase() + " (code " + httpResponse.getStatusLine().getStatusCode() + ")");
+
+ return IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8");
+ } catch (Exception e) {
+ throw new ClientException("Unable to read response content", e);
+ } finally {
+ try {
+ if (httpResponse != null)
+ httpResponse.close();
+ } catch (IOException e) {
+ logger.error("cannot close post", e);
}
- httpClient = httpClientBuilder.build();
}
+ }
- CloseableHttpResponse httpResponse = null;
+ @SuppressWarnings("unchecked")
+ protected CloseableHttpResponse getHttpResponse(AbstractRequest request) throws ClientException {
try {
HttpPost method = new HttpPost(clientConfiguration.getUrl() + "/ws.php");
method.setConfig(requestConfig);
@@ -115,46 +150,39 @@ else if (value instanceof List) {
}
method.setEntity(multipartEntityBuilder.build());
- httpResponse = httpClient.execute(method);
+ return getHttpClient().execute(method);
} catch (Exception e) {
throw new ClientException("Unable to send request", e);
}
+ }
- if (httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK)
- throw new ServerException(httpResponse.getStatusLine().getReasonPhrase() + " (code " + httpResponse.getStatusLine().getStatusCode() + ")");
-
- String content;
- try {
- content = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8");
- } catch (Exception e) {
- throw new ClientException("Unable to read response content", e);
- }
-
- try {
- if (httpResponse != null)
- httpResponse.close();
- } catch (IOException e) {
- logger.error("cannot close post", e);
- }
-
- // basic parsing
- ServerResponse errorResponse = parseResponse(httpResponse, content, ServerResponse.class, false);
+ protected CloseableHttpClient getHttpClient() {
+ if (httpClient == null) {
+ HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
- if ("fail".equals(errorResponse.status)) {
- logger.debug(content);
- throw new ServerException(errorResponse.error.toString());
- } else if (!"ok".equals(errorResponse.status))
- throw new NotImplementedException();
+ if (clientConfiguration.getUsesProxy()) {
+ String proxyUrl = clientConfiguration.getProxyUrl();
+ int proxyPort = clientConfiguration.getProxyPort();
+
+ String proxyUsername = clientConfiguration.getProxyUsername();
+ String proxyPassword = clientConfiguration.getProxyPassword();
- // complete parsing
- T response = parseResponse(httpResponse, content, request.getReturnType(), true);
- response.setHttpStatusCode(httpResponse.getStatusLine().getStatusCode());
- response.setXmlContent(content);
+ if (proxyUsername != null && proxyUsername.length() > 0 && proxyPassword != null && proxyPassword.length() > 0) {
+ CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+ credentialsProvider.setCredentials(new AuthScope(proxyUrl, proxyPort), new UsernamePasswordCredentials(proxyUsername, proxyPassword));
+ httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
+ }
- return response;
+ HttpHost proxy = new HttpHost(proxyUrl, proxyPort);
+ requestConfig = RequestConfig.custom().setProxy(proxy).build();
+ }
+ httpClient = httpClientBuilder.build();
+ }
+
+ return httpClient;
}
- private T parseResponse(HttpResponse httpResponse, String content, Class type, boolean strict) throws ClientException {
+ protected T parseResponse(String content, Class type, boolean strict) throws ClientException {
try {
return (T) PersisterFactory.createPersister().read(type, content, strict);
} catch (Exception e) {
diff --git a/remotesync-api/src/main/java/org/piwigo/remotesync/api/conf/SyncConfiguration.java b/remotesync-api/src/main/java/org/piwigo/remotesync/api/conf/SyncConfiguration.java
index 03a0ddb..cae066e 100644
--- a/remotesync-api/src/main/java/org/piwigo/remotesync/api/conf/SyncConfiguration.java
+++ b/remotesync-api/src/main/java/org/piwigo/remotesync/api/conf/SyncConfiguration.java
@@ -13,6 +13,7 @@
import java.lang.reflect.Field;
import org.kohsuke.args4j.Option;
+import org.piwigo.remotesync.api.Constants;
import org.piwigo.remotesync.api.ISyncConfiguration;
import org.piwigo.remotesync.api.conf.SyncConfigurationValidator.Validator;
import org.piwigo.remotesync.api.conf.SyncConfigurationValidator.ValidatorRequired;
@@ -22,10 +23,6 @@
import org.simpleframework.xml.convert.Convert;
public class SyncConfiguration implements ISyncConfiguration {
- private static final String DIRECTORY_DEFAULT = ConfigurationUtil.INSTANCE.getUserCurrentDirectory().getAbsolutePath();
-
- private static final String CHUNK_SIZE_DEFAULT = "500";
-
@Element(required = false)
@Option(name = "-url", usage = "remote gallery url")
@Validator(type = ValidatorType.url, required = ValidatorRequired.yes)
@@ -46,7 +43,7 @@ public class SyncConfiguration implements ISyncConfiguration {
@Element(required = false)
@Option(name = "-dir", usage = "local directory path")
@Validator(type = ValidatorType.dir)
- protected String directory = DIRECTORY_DEFAULT;
+ protected String directory = Constants.DIRECTORY_DEFAULT;
@Element(required = false)
@Option(name = "-proxy", usage = "use proxy")
@@ -76,7 +73,7 @@ public class SyncConfiguration implements ISyncConfiguration {
@Element(required = false)
@Option(name = "-cs", usage = "chunk size (in Kbytes)")
@Validator(type = ValidatorType.integer)
- protected String chunkSize = CHUNK_SIZE_DEFAULT;
+ protected String chunkSize = Constants.CHUNK_SIZE_DEFAULT;
public String getValue(String fieldName) {
try {
@@ -180,7 +177,7 @@ public int getChunkSize() {
try {
return Integer.parseInt(chunkSize);
} catch (NumberFormatException e) {
- return Integer.parseInt(CHUNK_SIZE_DEFAULT);
+ return Integer.parseInt(Constants.CHUNK_SIZE_DEFAULT);
}
}
diff --git a/remotesync-api/src/main/java/org/piwigo/remotesync/api/request/IChunkable.java b/remotesync-api/src/main/java/org/piwigo/remotesync/api/request/IChunkable.java
new file mode 100644
index 0000000..c051d1c
--- /dev/null
+++ b/remotesync-api/src/main/java/org/piwigo/remotesync/api/request/IChunkable.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Matthieu Helleboid.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ *
+ * Contributors:
+ * Matthieu Helleboid - initial API and implementation
+ ******************************************************************************/
+package org.piwigo.remotesync.api.request;
+
+public interface IChunkable {
+ public void setChunkSize(int chunkSize);
+}
diff --git a/remotesync-api/src/main/java/org/piwigo/remotesync/api/request/PwgImagesAddAllChunksRequest.java b/remotesync-api/src/main/java/org/piwigo/remotesync/api/request/PwgImagesAddAllChunksRequest.java
index e2a06e9..2e7682a 100644
--- a/remotesync-api/src/main/java/org/piwigo/remotesync/api/request/PwgImagesAddAllChunksRequest.java
+++ b/remotesync-api/src/main/java/org/piwigo/remotesync/api/request/PwgImagesAddAllChunksRequest.java
@@ -13,17 +13,16 @@
import java.io.File;
import java.util.Iterator;
-import org.piwigo.remotesync.api.conf.ConfigurationUtil;
+import org.piwigo.remotesync.api.Constants;
import org.piwigo.remotesync.api.exception.ClientException;
-import org.piwigo.remotesync.api.request.PwgImagesAddChunkRequest;
import org.piwigo.remotesync.api.response.BasicResponse;
import org.piwigo.remotesync.api.util.FileUtil;
-public class PwgImagesAddAllChunksRequest extends ComposedRequest {
+public class PwgImagesAddAllChunksRequest extends ComposedRequest implements IChunkable {
private File file;
- //TODO store it
- private final int chunkSize = 1024 * ConfigurationUtil.INSTANCE.getUserConfiguration().getCurrentSyncConfiguration().getChunkSize();
+
+ private int chunkSize = Constants.CHUNK_SIZE_INT_DEFAULT;
public PwgImagesAddAllChunksRequest(File file) throws ClientException {
this.file = file;
@@ -31,7 +30,7 @@ public PwgImagesAddAllChunksRequest(File file) throws ClientException {
@Override
public Iterator> iterator() {
- final int chunkNumber = FileUtil.getChunkNumber(file, chunkSize);
+ final int chunkNumber = FileUtil.getChunkNumber(file, getTechnicalChunkSize());
final String md5Sum = FileUtil.getFileContentMD5Sum(file);
return new ComposedRequestIterator(requests) {
@@ -45,9 +44,18 @@ public boolean hasNext() {
@Override
public AbstractRequest extends BasicResponse> next() {
- String data = FileUtil.getBase64String(file, chunkSize, chunkId);
+ String data = FileUtil.getBase64String(file, getTechnicalChunkSize(), chunkId);
return new PwgImagesAddChunkRequest(data, md5Sum, chunkId++);
}
};
}
+
+ private int getTechnicalChunkSize() {
+ return 1024 * chunkSize;
+ }
+
+ @Override
+ public void setChunkSize(int chunkSize) {
+ this.chunkSize = chunkSize;
+ }
}
diff --git a/remotesync-api/src/main/java/org/piwigo/remotesync/api/response/BasicResponse.java b/remotesync-api/src/main/java/org/piwigo/remotesync/api/response/BasicResponse.java
index 3373bf8..97e4ca7 100644
--- a/remotesync-api/src/main/java/org/piwigo/remotesync/api/response/BasicResponse.java
+++ b/remotesync-api/src/main/java/org/piwigo/remotesync/api/response/BasicResponse.java
@@ -20,9 +20,7 @@ public class BasicResponse {
@Attribute(name = "stat")
public String status;
- private int httpStatusCode;
-
- private String xmlContent;
+ protected String xmlContent;
public String getXmlContent() {
return xmlContent;
@@ -32,14 +30,6 @@ public void setXmlContent(String xmlContent) {
this.xmlContent = xmlContent;
}
- public void setHttpStatusCode(int httpStatusCode) {
- this.httpStatusCode = httpStatusCode;
- }
-
- public int getHttpStatusCode() {
- return httpStatusCode;
- }
-
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
diff --git a/remotesync-api/src/main/resources/org/piwigo/remotesync/generator/apiTemplate.jmte b/remotesync-api/src/main/resources/org/piwigo/remotesync/generator/apiTemplate.jmte
index f427f19..b209603 100644
--- a/remotesync-api/src/main/resources/org/piwigo/remotesync/generator/apiTemplate.jmte
+++ b/remotesync-api/src/main/resources/org/piwigo/remotesync/generator/apiTemplate.jmte
@@ -18,7 +18,7 @@ import org.piwigo.remotesync.api.response.*;
${generatedComment}
public abstract class ${apiName} {
- protected abstract Client getClient();
+ protected abstract IClient getClient();
${foreach methodDetails methodDetail}
${if !methodDetail.hasMandatoryParameters}
diff --git a/remotesync-api/src/test/java/org/piwigo/remotesync/api/test/SyncTest.java b/remotesync-api/src/test/java/org/piwigo/remotesync/api/test/SyncTest.java
index 068e4db..e867c79 100644
--- a/remotesync-api/src/test/java/org/piwigo/remotesync/api/test/SyncTest.java
+++ b/remotesync-api/src/test/java/org/piwigo/remotesync/api/test/SyncTest.java
@@ -19,7 +19,16 @@
public class SyncTest extends AbstractTestCase {
public void testLegacyCache() throws URISyntaxException {
- LegacyCache legacyCache = new LegacyCache("test", null);
+ LegacyCache legacyCache = new LegacyCache("http://a", null);
+
+ assertTrue(legacyCache.isSameUrl("http://a"));
+ assertTrue(legacyCache.isSameUrl("https://a"));
+ assertFalse(legacyCache.isSameUrl("http://b"));
+ assertFalse(legacyCache.isSameUrl("https://b"));
+ }
+
+ public void testLegacyCache1() throws URISyntaxException {
+ LegacyCache legacyCache = new LegacyCache("url", null);
AlbumCacheElement a = new AlbumCacheElement("url", 3);
legacyCache.parseContent(a.writeToString());
@@ -33,12 +42,17 @@ public void testLegacyCache() throws URISyntaxException {
public void testLegacyCache2() throws URISyntaxException {
assertTrue(getPiwigoImportTreeFile().exists());
- LegacyCache legacyCache = new LegacyCache(null, getPiwigoImportTreeFile());
+ LegacyCache legacyCache = new LegacyCache("http://localhost/piwigo/dev/branches/2.6/", getPiwigoImportTreeFile());
legacyCache.parseFile();
assertEquals(116, legacyCache.getAlbumCacheElement().getId().intValue());
assertEquals(20, legacyCache.getImagesCache().size());
assertEquals(502, legacyCache.getImagesCache().get(0).getId().intValue());
assertEquals(521, legacyCache.getImagesCache().get(19).getId().intValue());
assertEquals("d2d97dd5727972522adfd82f43daddcd", legacyCache.getImagesCache().get(1).getFilePathMD5());
+
+ legacyCache = new LegacyCache("http://other", getPiwigoImportTreeFile());
+ legacyCache.parseFile();
+ assertNull(legacyCache.getAlbumCacheElement());
+ assertEquals(0, legacyCache.getImagesCache().size());
}
}
diff --git a/remotesync-ui/pom.xml b/remotesync-ui/pom.xml
index d3dba8b..7aebf4e 100644
--- a/remotesync-ui/pom.xml
+++ b/remotesync-ui/pom.xml
@@ -17,7 +17,7 @@
piwigo
remotesync-api
- 0.0.7
+ 0.0.8
org.apache.pivot
@@ -34,6 +34,8 @@
org.piwigo.remotesync.ui.MainUi
+ true
+ true
@@ -42,12 +44,17 @@
maven-assembly-plugin
2.4
+ remotesync-ui
+ ../remotesync/target/
+ false
jar-with-dependencies
org.piwigo.remotesync.ui.MainUi
+ true
+ true
@@ -66,7 +73,7 @@
piwigo
remotesync
- 0.0.7
+ 0.0.8
../remotesync
diff --git a/remotesync/README.txt b/remotesync/README.txt
index aad6c67..a2eef99 100644
--- a/remotesync/README.txt
+++ b/remotesync/README.txt
@@ -21,8 +21,8 @@ cd remotesync
mvn -Dmaven.test.skip=true clean package
#show help
-java -jar ../remotesync-api/target/remotesync-api-0.0.7-jar-with-dependencies.jar -help
-java -jar ../remotesync-ui/target/remotesync-ui-0.0.7-jar-with-dependencies.jar -help
+java -jar target/remotesync.jar -help
+java -jar target/remotesync-ui.jar -help
#launch remote sync ui
-java -jar ../remotesync-ui/target/remotesync-ui-0.0.7-jar-with-dependencies.jar
+java -jar target/remotesync-ui.jar
diff --git a/remotesync/pom.xml b/remotesync/pom.xml
index f9b1e6d..b056353 100644
--- a/remotesync/pom.xml
+++ b/remotesync/pom.xml
@@ -14,7 +14,7 @@
piwigo
remotesync
Piwigo Remote Sync
- 0.0.7
+ 0.0.8
pom
../remotesync-api