add rootFolderId as parameter

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portal/ws-synchronized-module-library@165493 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-03-28 12:54:33 +00:00
parent 634ca52339
commit a41af18f23
3 changed files with 69 additions and 42 deletions

View File

@ -30,23 +30,43 @@ public class ThSynchFolderConfiguration implements Serializable{
/** The remote persistence. */
private String remotePersistence="thredds";
private String rootFolderId;
public ThSynchFolderConfiguration() {
// TODO Auto-generated constructor stub
}
public ThSynchFolderConfiguration(String remotePath, String filter, String targetToken, String toCreateCatalogName,
String remotePersistence) {
String remotePersistence, String rootFolderId) {
super();
this.remotePath = remotePath;
this.filter = filter;
this.targetToken = targetToken;
this.toCreateCatalogName = toCreateCatalogName;
this.remotePersistence = remotePersistence;
this.rootFolderId = rootFolderId;
}
/**
* @return the rootFolderId
*/
public String getRootFolderId() {
return rootFolderId;
}
/**
* @param rootFolderId the rootFolderId to set
*/
public void setRootFolderId(String rootFolderId) {
this.rootFolderId = rootFolderId;
}
public String getRemotePath() {
return remotePath;
@ -115,23 +135,28 @@ public class ThSynchFolderConfiguration implements Serializable{
this.remotePersistence = remotePersistence;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ThSynchFolderConfiguration [remotePath=");
builder.append(remotePath);
builder.append(", filter=");
builder.append(filter);
builder.append(", targetToken=");
builder.append(targetToken!=null && targetToken.length()>3?targetToken.substring(0,targetToken.length()-3):"");
builder.append(targetToken);
builder.append(", toCreateCatalogName=");
builder.append(toCreateCatalogName);
builder.append(", remotePersistence=");
builder.append(remotePersistence);
builder.append(", rootFolderId=");
builder.append(rootFolderId);
builder.append("]");
return builder.toString();
}
}

View File

@ -81,7 +81,9 @@ public class ThreddsConverter {
String filter = t.getFilter()!=null && !t.getFilter().isEmpty()?t.getFilter():THREDDS_FILTER_NC_NCML_ASC;
return new SynchFolderConfiguration(t.getRemotePath(), filter, t.getTargetToken(), t.getToCreateCatalogName());
// return new SynchFolderConfiguration(t.getRemotePath(), filter, t.getTargetToken(), t.getToCreateCatalogName());
return new SynchFolderConfiguration(t.getRemotePath(), filter, t.getTargetToken(), t.getToCreateCatalogName(), t.getRootFolderId());
}
};
@ -100,6 +102,7 @@ public class ThreddsConverter {
mySync.setRemotePersistence(t.getRemotePersistence());
mySync.setTargetToken(t.getTargetToken());
mySync.setToCreateCatalogName(t.getToCreateCatalogName());
mySync.setRootFolderId(t.getRootFolderId());
return mySync;
}
};

View File

@ -2,7 +2,6 @@
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.concurrent.Semaphore;
import org.gcube.common.homelibrary.home.HomeLibrary;
import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException;
@ -70,7 +69,7 @@ public class TestWsThreddsEngine {
String remotePersistence = "";
String remotePath = "";
String targetToken = "";
SynchFolderConfiguration config = new SynchFolderConfiguration(remotePath, filter, targetToken, remotePersistence);
SynchFolderConfiguration config = new SynchFolderConfiguration(remotePath, filter, targetToken, remotePersistence, folder.getId());
try {
//try to clean it up, first..