fixed javadoc for java8
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@148711 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
60e7a89063
commit
bb18ce0fb9
1
pom.xml
1
pom.xml
|
@ -22,6 +22,7 @@
|
|||
<distroDirectory>distro</distroDirectory>
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<!-- <additionalparam>-Xdoclint:none</additionalparam> -->
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -6,10 +6,12 @@ package org.gcube.datatransfer.resolver.applicationprofile;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @Oct 13, 2014
|
||||
* The Class ScopeUtil.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class ScopeUtil {
|
||||
|
||||
|
@ -17,6 +19,13 @@ public class ScopeUtil {
|
|||
public static final Logger logger = LoggerFactory.getLogger(ScopeUtil.class);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the infrastructure name from scope.
|
||||
*
|
||||
* @param scope the scope
|
||||
* @return the infrastructure name from scope
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public static String getInfrastructureNameFromScope(String scope) throws Exception{
|
||||
|
||||
if(scope==null || scope.isEmpty()){
|
||||
|
|
|
@ -23,10 +23,12 @@ import org.slf4j.LoggerFactory;
|
|||
import org.w3c.dom.Node;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
|
||||
/**
|
||||
* The Class GetCkanPorltet.
|
||||
* The Class CkanPorltetApplicationProfile.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Dec 2, 2016
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class CkanPorltetApplicationProfile {
|
||||
|
||||
|
@ -37,7 +39,7 @@ public class CkanPorltetApplicationProfile {
|
|||
* Gets the portlet url from infrastrucure.
|
||||
*
|
||||
* @return the portlet url from infrastrucure
|
||||
* @throws Exception
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public static String getPortletUrlFromInfrastrucure() throws Exception {
|
||||
|
||||
|
|
|
@ -21,10 +21,12 @@ import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @Oct 7, 2014
|
||||
* The Class GeoRuntimeReader.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class GeoRuntimeReader {
|
||||
|
||||
|
@ -32,10 +34,24 @@ public class GeoRuntimeReader {
|
|||
public static final String GEONETWORK_RESOURCE_NAME = "GeoNetwork";
|
||||
public static final String WORKSPACES_PROPERTY_NAME = "workspaces";
|
||||
|
||||
/**
|
||||
* The Enum GEO_SERVICE.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 16, 2017
|
||||
*/
|
||||
public static enum GEO_SERVICE{GEOSERVER, GEONETWORK};
|
||||
|
||||
public static final Logger logger = LoggerFactory.getLogger(GeoRuntimeReader.class);
|
||||
|
||||
/**
|
||||
* Gets the parameters.
|
||||
*
|
||||
* @param scope the scope
|
||||
* @param geoservice the geoservice
|
||||
* @return the parameters
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
private ServerParameters getParameters(String scope, GEO_SERVICE geoservice) throws Exception{
|
||||
String originalScope = ScopeProvider.instance.get();
|
||||
ServerParameters parameters = new ServerParameters();
|
||||
|
@ -101,6 +117,14 @@ public class GeoRuntimeReader {
|
|||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve gis parameters.
|
||||
*
|
||||
* @param scope the scope
|
||||
* @param geoservice the geoservice
|
||||
* @return the server parameters
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public ServerParameters retrieveGisParameters(String scope, GEO_SERVICE geoservice) throws Exception
|
||||
{
|
||||
if(geoservice==null)
|
||||
|
|
|
@ -16,11 +16,12 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The Class GeonetworkInstance.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Jun 9, 2016
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class GeonetworkInstance {
|
||||
|
||||
|
@ -53,7 +54,6 @@ public class GeonetworkInstance {
|
|||
*
|
||||
* @param authenticate the authenticate
|
||||
* @param level the level
|
||||
* @param type the type
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public GeonetworkInstance(boolean authenticate, LoginLevel level) throws Exception {
|
||||
|
@ -112,7 +112,6 @@ public class GeonetworkInstance {
|
|||
*
|
||||
* @param authenticate the authenticate
|
||||
* @param level the level
|
||||
* @param type the type
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
private void createInstanceGeonetworkPublisher(boolean authenticate, LoginLevel level) throws Exception {
|
||||
|
@ -163,6 +162,8 @@ public class GeonetworkInstance {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the account.
|
||||
*
|
||||
* @return the account
|
||||
*/
|
||||
public Account getAccount() {
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.gcube.datatransfer.resolver.gis.GeonetworkAccessParameter.GeonetworkL
|
|||
* The Interface GeonetworkServiceInterface.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @Oct 7, 2014
|
||||
*/
|
||||
public interface GeonetworkServiceInterface {
|
||||
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
package org.gcube.datatransfer.resolver.gis.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The Class GeoserverBaseUri.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Jan 13, 2016
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class GeoserverBaseUri implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3321571622161066198L;
|
||||
private String baseUrl = "";
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
package org.gcube.datatransfer.resolver.gis.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @Oct 7, 2014
|
||||
* The Class GisLayerItem.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class GisLayerItem {
|
||||
|
||||
|
@ -29,19 +31,20 @@ public class GisLayerItem {
|
|||
private String setCrsWMS;
|
||||
|
||||
/**
|
||||
* @param uuid
|
||||
* @param citationTitle
|
||||
* @param layerName
|
||||
* @param topicCategory
|
||||
* @param publicationDate
|
||||
* @param scopeCode
|
||||
* @param geoserverBaseUrlOnlineResource
|
||||
* @param baseWmsServiceUrl
|
||||
* @param fullWmsUrlRequest
|
||||
* @param b
|
||||
* @param styles
|
||||
* @param metaAbstract
|
||||
* @param listKeywords
|
||||
* Instantiates a new gis layer item.
|
||||
*
|
||||
* @param uuid the uuid
|
||||
* @param citationTitle the citation title
|
||||
* @param layerName the layer name
|
||||
* @param topicCategory the topic category
|
||||
* @param publicationDate the publication date
|
||||
* @param scopeCode the scope code
|
||||
* @param geoserverBaseUrlOnlineResource the geoserver base url online resource
|
||||
* @param baseWmsServiceUrl the base wms service url
|
||||
* @param fullWmsUrlRequest the full wms url request
|
||||
* @param styles the styles
|
||||
* @param metaAbstract the meta abstract
|
||||
* @param listKeywords the list keywords
|
||||
*/
|
||||
public GisLayerItem(String uuid, String citationTitle, String layerName,
|
||||
String topicCategory, Date publicationDate, String scopeCode,
|
||||
|
@ -63,129 +66,271 @@ public class GisLayerItem {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param versionWms
|
||||
* Sets the version wms.
|
||||
*
|
||||
* @param versionWms the new version wms
|
||||
*/
|
||||
public void setVersionWMS(String versionWms) {
|
||||
this.versionWMS = versionWms;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param crs
|
||||
* Sets the crs wms.
|
||||
*
|
||||
* @param crs the new crs wms
|
||||
*/
|
||||
public void setCrsWMS(String crs) {
|
||||
this.setCrsWMS =crs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the uuid.
|
||||
*
|
||||
* @return the uuid
|
||||
*/
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the citation title.
|
||||
*
|
||||
* @return the citation title
|
||||
*/
|
||||
public String getCitationTitle() {
|
||||
return citationTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the layer name.
|
||||
*
|
||||
* @return the layer name
|
||||
*/
|
||||
public String getLayerName() {
|
||||
return layerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the topic category.
|
||||
*
|
||||
* @return the topic category
|
||||
*/
|
||||
public String getTopicCategory() {
|
||||
return topicCategory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the publication date.
|
||||
*
|
||||
* @return the publication date
|
||||
*/
|
||||
public Date getPublicationDate() {
|
||||
return publicationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the scope code.
|
||||
*
|
||||
* @return the scope code
|
||||
*/
|
||||
public String getScopeCode() {
|
||||
return scopeCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the geoserver base url on line resource.
|
||||
*
|
||||
* @return the geoserver base url on line resource
|
||||
*/
|
||||
public String getGeoserverBaseUrlOnLineResource() {
|
||||
return geoserverBaseUrlOnLineResource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the base wms service url.
|
||||
*
|
||||
* @return the base wms service url
|
||||
*/
|
||||
public String getBaseWmsServiceUrl() {
|
||||
return baseWmsServiceUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the full wms url request.
|
||||
*
|
||||
* @return the full wms url request
|
||||
*/
|
||||
public String getFullWmsUrlRequest() {
|
||||
return fullWmsUrlRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the styles.
|
||||
*
|
||||
* @return the styles
|
||||
*/
|
||||
public List<String> getStyles() {
|
||||
return styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the meta abstract.
|
||||
*
|
||||
* @return the meta abstract
|
||||
*/
|
||||
public String getMetaAbstract() {
|
||||
return metaAbstract;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list keywords.
|
||||
*
|
||||
* @return the list keywords
|
||||
*/
|
||||
public List<String> getListKeywords() {
|
||||
return listKeywords;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the uuid.
|
||||
*
|
||||
* @param uuid the new uuid
|
||||
*/
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the citation title.
|
||||
*
|
||||
* @param citationTitle the new citation title
|
||||
*/
|
||||
public void setCitationTitle(String citationTitle) {
|
||||
this.citationTitle = citationTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the layer name.
|
||||
*
|
||||
* @param layerName the new layer name
|
||||
*/
|
||||
public void setLayerName(String layerName) {
|
||||
this.layerName = layerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the topic category.
|
||||
*
|
||||
* @param topicCategory the new topic category
|
||||
*/
|
||||
public void setTopicCategory(String topicCategory) {
|
||||
this.topicCategory = topicCategory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the publication date.
|
||||
*
|
||||
* @param publicationDate the new publication date
|
||||
*/
|
||||
public void setPublicationDate(Date publicationDate) {
|
||||
this.publicationDate = publicationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the scope code.
|
||||
*
|
||||
* @param scopeCode the new scope code
|
||||
*/
|
||||
public void setScopeCode(String scopeCode) {
|
||||
this.scopeCode = scopeCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the geoserver base url on line resource.
|
||||
*
|
||||
* @param geoserverBaseUrlOnLineResource the new geoserver base url on line resource
|
||||
*/
|
||||
public void setGeoserverBaseUrlOnLineResource(
|
||||
String geoserverBaseUrlOnLineResource) {
|
||||
this.geoserverBaseUrlOnLineResource = geoserverBaseUrlOnLineResource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the base wms service url.
|
||||
*
|
||||
* @param baseWmsServiceUrl the new base wms service url
|
||||
*/
|
||||
public void setBaseWmsServiceUrl(String baseWmsServiceUrl) {
|
||||
this.baseWmsServiceUrl = baseWmsServiceUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the full wms url request.
|
||||
*
|
||||
* @param fullWmsUrlRequest the new full wms url request
|
||||
*/
|
||||
public void setFullWmsUrlRequest(String fullWmsUrlRequest) {
|
||||
this.fullWmsUrlRequest = fullWmsUrlRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the styles.
|
||||
*
|
||||
* @param styles the new styles
|
||||
*/
|
||||
public void setStyles(List<String> styles) {
|
||||
this.styles = styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the meta abstract.
|
||||
*
|
||||
* @param metaAbstract the new meta abstract
|
||||
*/
|
||||
public void setMetaAbstract(String metaAbstract) {
|
||||
this.metaAbstract = metaAbstract;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the list keywords.
|
||||
*
|
||||
* @param listKeywords the new list keywords
|
||||
*/
|
||||
public void setListKeywords(List<String> listKeywords) {
|
||||
this.listKeywords = listKeywords;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the version wms.
|
||||
*
|
||||
* @return the version wms
|
||||
*/
|
||||
public String getVersionWMS() {
|
||||
return versionWMS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sets the crs wms.
|
||||
*
|
||||
* @return the sets the crs wms
|
||||
*/
|
||||
public String getSetCrsWMS() {
|
||||
return setCrsWMS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sets the crs wms.
|
||||
*
|
||||
* @param setCrsWMS the new sets the crs wms
|
||||
*/
|
||||
public void setSetCrsWMS(String setCrsWMS) {
|
||||
this.setCrsWMS = setCrsWMS;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
@ -220,7 +365,7 @@ public class GisLayerItem {
|
|||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,29 +2,35 @@ package org.gcube.datatransfer.resolver.gis.entity;
|
|||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @Oct 7, 2014
|
||||
* The Class ServerParameters.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class ServerParameters implements Serializable{
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2459971193655529274L;
|
||||
|
||||
|
||||
protected String url;
|
||||
protected String user;
|
||||
protected String password;
|
||||
|
||||
public ServerParameters(){}
|
||||
|
||||
|
||||
/**
|
||||
* @param url
|
||||
* @param user
|
||||
* @param password
|
||||
* Instantiates a new server parameters.
|
||||
*/
|
||||
public ServerParameters(){}
|
||||
|
||||
/**
|
||||
* Instantiates a new server parameters.
|
||||
*
|
||||
* @param url the url
|
||||
* @param user the user
|
||||
* @param password the password
|
||||
*/
|
||||
public ServerParameters(String url, String user, String password) {
|
||||
this.url = url;
|
||||
|
@ -33,6 +39,8 @@ public class ServerParameters implements Serializable{
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the url.
|
||||
*
|
||||
* @return the url
|
||||
*/
|
||||
public String getUrl() {
|
||||
|
@ -40,6 +48,8 @@ public class ServerParameters implements Serializable{
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the url.
|
||||
*
|
||||
* @param url the url to set
|
||||
*/
|
||||
public void setUrl(String url) {
|
||||
|
@ -47,6 +57,8 @@ public class ServerParameters implements Serializable{
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the user.
|
||||
*
|
||||
* @return the user
|
||||
*/
|
||||
public String getUser() {
|
||||
|
@ -54,6 +66,8 @@ public class ServerParameters implements Serializable{
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the user.
|
||||
*
|
||||
* @param user the user to set
|
||||
*/
|
||||
public void setUser(String user) {
|
||||
|
@ -61,6 +75,8 @@ public class ServerParameters implements Serializable{
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the password.
|
||||
*
|
||||
* @return the password
|
||||
*/
|
||||
public String getPassword() {
|
||||
|
@ -68,12 +84,17 @@ public class ServerParameters implements Serializable{
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the password.
|
||||
*
|
||||
* @param password the password to set
|
||||
*/
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
|
|
@ -6,11 +6,12 @@ package org.gcube.datatransfer.resolver.gis.exception;
|
|||
import org.gcube.spatial.data.geonetwork.model.faults.AuthorizationException;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The Class GeonetworkInstanceException.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Jan 13, 2016
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class GeonetworkInstanceException extends Exception {
|
||||
|
||||
|
|
|
@ -1,28 +1,35 @@
|
|||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
package org.gcube.datatransfer.resolver.gis.exception;
|
||||
|
||||
|
||||
/**
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @Oct 14, 2014
|
||||
* The Class IllegalArgumentException.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class IllegalArgumentException extends Exception {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8589705350737964325L;
|
||||
|
||||
/**
|
||||
*
|
||||
* Instantiates a new illegal argument exception.
|
||||
*/
|
||||
public IllegalArgumentException() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new illegal argument exception.
|
||||
*
|
||||
* @param message the message
|
||||
*/
|
||||
public IllegalArgumentException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
|
|
@ -11,11 +11,12 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The Class GNAuthentication.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Apr 4, 2016
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class GNAuthentication {
|
||||
|
||||
|
@ -24,9 +25,9 @@ public class GNAuthentication {
|
|||
private static final String SRV_EN_XML_USER_LOGIN = "/srv/en/xml.user.login";
|
||||
|
||||
/**
|
||||
* Perform a GN login.<br/>
|
||||
* Perform a GN login.<br>
|
||||
* GN auth is carried out via a JSESSIONID cookie returned by a successful login
|
||||
* call.<br/>
|
||||
* call.<br>
|
||||
*
|
||||
* <ul>
|
||||
* <li>Url: <tt>http://<i>server</i>:<i>port</i>/geonetwork/srv/en/xml.user.login</tt></li>
|
||||
|
|
|
@ -13,10 +13,12 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @Apr 26, 2013
|
||||
* The Class HttpRequestUtil.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class HttpRequestUtil {
|
||||
|
||||
|
@ -25,6 +27,14 @@ public class HttpRequestUtil {
|
|||
private static final int CONNECTION_TIMEOUT = 1000;
|
||||
public static Logger logger = LoggerFactory.getLogger(HttpRequestUtil.class);
|
||||
|
||||
/**
|
||||
* Url exists.
|
||||
*
|
||||
* @param urlConn the url conn
|
||||
* @param verifyIsWmsGeoserver the verify is wms geoserver
|
||||
* @return true, if successful
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public static boolean urlExists(String urlConn, boolean verifyIsWmsGeoserver) throws Exception {
|
||||
|
||||
URL url;
|
||||
|
@ -34,26 +44,26 @@ public class HttpRequestUtil {
|
|||
URLConnection connection = url.openConnection();
|
||||
connection.setConnectTimeout(CONNECTION_TIMEOUT);
|
||||
connection.setReadTimeout(CONNECTION_TIMEOUT+CONNECTION_TIMEOUT);
|
||||
|
||||
|
||||
logger.trace("open connection on: " + url);
|
||||
|
||||
// Cast to a HttpURLConnection
|
||||
if (connection instanceof HttpURLConnection) {
|
||||
HttpURLConnection httpConnection = (HttpURLConnection) connection;
|
||||
|
||||
|
||||
httpConnection.setRequestMethod("GET");
|
||||
|
||||
int code = httpConnection.getResponseCode();
|
||||
|
||||
|
||||
if(verifyIsWmsGeoserver)
|
||||
return isGeoserver(httpConnection);
|
||||
|
||||
|
||||
httpConnection.disconnect();
|
||||
|
||||
|
||||
if (code == 200) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// logger.trace("result: "+result);
|
||||
|
||||
} else {
|
||||
|
@ -76,16 +86,23 @@ public class HttpRequestUtil {
|
|||
throw new Exception("Error Exception");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Checks if is geoserver.
|
||||
*
|
||||
* @param httpConnection the http connection
|
||||
* @return true, if is geoserver
|
||||
* @throws IOException Signals that an I/O exception has occurred.
|
||||
*/
|
||||
private static boolean isGeoserver(HttpURLConnection httpConnection) throws IOException{
|
||||
|
||||
|
||||
BufferedReader rd = new BufferedReader(new InputStreamReader(httpConnection.getInputStream()));
|
||||
String line;
|
||||
String result = "";
|
||||
|
||||
|
||||
int code = httpConnection.getResponseCode();
|
||||
|
||||
|
||||
if (code == 200) {
|
||||
while ((line = rd.readLine()) != null) {
|
||||
result += line;
|
||||
|
@ -101,9 +118,15 @@ public class HttpRequestUtil {
|
|||
}
|
||||
rd.close();
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The main method.
|
||||
*
|
||||
* @param args the arguments
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println(HttpRequestUtil.urlExists("http://geoserver2.d4science.research-infrastructures.eu/geoserver/wms", true));
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import javax.xml.namespace.NamespaceContext;
|
|||
* The Class NamespaceCsw.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Jun 16, 2016
|
||||
* May 16, 2017
|
||||
*/
|
||||
public class NamespaceCsw extends NamespaceISO19139 implements NamespaceContext {
|
||||
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
package org.gcube.datatransfer.resolver.gis.util;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The Class NamespaceISO19139.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 16, 2017
|
||||
*/
|
||||
public abstract class NamespaceISO19139 {
|
||||
|
||||
|
||||
|
@ -40,87 +47,254 @@ public abstract class NamespaceISO19139 {
|
|||
private final String prefixWMS = "wms";
|
||||
|
||||
|
||||
/**
|
||||
* Gets the namespace csw.
|
||||
*
|
||||
* @return the namespace csw
|
||||
*/
|
||||
public String getNamespaceCSW() {
|
||||
return namespaceCSW;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace dc.
|
||||
*
|
||||
* @return the namespace dc
|
||||
*/
|
||||
public String getNamespaceDC() {
|
||||
return namespaceDC;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace ows.
|
||||
*
|
||||
* @return the namespace ows
|
||||
*/
|
||||
public String getNamespaceOWS() {
|
||||
return namespaceOWS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace gmd.
|
||||
*
|
||||
* @return the namespace gmd
|
||||
*/
|
||||
public String getNamespaceGMD() {
|
||||
return namespaceGMD;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace gco.
|
||||
*
|
||||
* @return the namespace gco
|
||||
*/
|
||||
public String getNamespaceGCO() {
|
||||
return namespaceGCO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace xlink.
|
||||
*
|
||||
* @return the namespace xlink
|
||||
*/
|
||||
public String getNamespaceXLINK() {
|
||||
return namespaceXLINK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace srv.
|
||||
*
|
||||
* @return the namespace srv
|
||||
*/
|
||||
public String getNamespaceSRV() {
|
||||
return namespaceSRV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace xsi.
|
||||
*
|
||||
* @return the namespace xsi
|
||||
*/
|
||||
public String getNamespaceXSI() {
|
||||
return namespaceXSI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace gml.
|
||||
*
|
||||
* @return the namespace gml
|
||||
*/
|
||||
public String getNamespaceGML() {
|
||||
return namespaceGML;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace gts.
|
||||
*
|
||||
* @return the namespace gts
|
||||
*/
|
||||
public String getNamespaceGTS() {
|
||||
return namespaceGTS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace geonet.
|
||||
*
|
||||
* @return the namespace geonet
|
||||
*/
|
||||
public String getNamespaceGEONET() {
|
||||
return namespaceGEONET;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix csw.
|
||||
*
|
||||
* @return the prefix csw
|
||||
*/
|
||||
public String getPrefixCSW() {
|
||||
return prefixCSW;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix gmd.
|
||||
*
|
||||
* @return the prefix gmd
|
||||
*/
|
||||
public String getPrefixGMD() {
|
||||
return prefixGMD;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix ows.
|
||||
*
|
||||
* @return the prefix ows
|
||||
*/
|
||||
public String getPrefixOWS() {
|
||||
return prefixOWS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix dc.
|
||||
*
|
||||
* @return the prefix dc
|
||||
*/
|
||||
public String getPrefixDC() {
|
||||
return prefixDC;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix gco.
|
||||
*
|
||||
* @return the prefix gco
|
||||
*/
|
||||
public String getPrefixGCO() {
|
||||
return prefixGCO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix xlink.
|
||||
*
|
||||
* @return the prefix xlink
|
||||
*/
|
||||
public String getPrefixXLINK() {
|
||||
return prefixXLINK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix srv.
|
||||
*
|
||||
* @return the prefix srv
|
||||
*/
|
||||
public String getPrefixSRV() {
|
||||
return prefixSRV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix gml.
|
||||
*
|
||||
* @return the prefix gml
|
||||
*/
|
||||
public String getPrefixGML() {
|
||||
return prefixGML;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix gts.
|
||||
*
|
||||
* @return the prefix gts
|
||||
*/
|
||||
public String getPrefixGTS() {
|
||||
return prefixGTS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix geonet.
|
||||
*
|
||||
* @return the prefix geonet
|
||||
*/
|
||||
public String getPrefixGEONET() {
|
||||
return prefixGEONET;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix xsi.
|
||||
*
|
||||
* @return the prefix xsi
|
||||
*/
|
||||
public String getPrefixXSI() {
|
||||
return prefixXSI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix gmx.
|
||||
*
|
||||
* @return the prefix gmx
|
||||
*/
|
||||
public String getPrefixGMX() {
|
||||
return prefixGMX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace gmx.
|
||||
*
|
||||
* @return the namespace gmx
|
||||
*/
|
||||
public String getNamespaceGMX() {
|
||||
return namespaceGMX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix wms.
|
||||
*
|
||||
* @return the prefix wms
|
||||
*/
|
||||
public String getPrefixWMS() {
|
||||
return prefixWMS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace wms.
|
||||
*
|
||||
* @return the namespace wms
|
||||
*/
|
||||
public String getNamespaceWMS() {
|
||||
return namespaceWMS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace dct.
|
||||
*
|
||||
* @return the namespace dct
|
||||
*/
|
||||
public String getNamespaceDCT() {
|
||||
return namespaceDCT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the prefix dct.
|
||||
*
|
||||
* @return the prefix dct
|
||||
*/
|
||||
public String getPrefixDCT() {
|
||||
return prefixDCT;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue