String getTslLocation() {
   logger.debug("");
   String urlString = getConfigurationParameter("tslLocation");
   if (!Protocol.isFileUrl(urlString)) return urlString;
   try {
     String filePath = new URL(urlString).getPath();
     if (!new File(filePath).exists()) {
       URL resource = getClass().getClassLoader().getResource(filePath);
       if (resource != null) urlString = resource.toString();
     }
   } catch (MalformedURLException e) {
     logger.warn(e.getMessage());
   }
   return urlString;
 }
Exemple #2
0
  @Override
  public byte[] get(final String urlString) throws DSSCannotFetchDataException {

    if (Protocol.isFileUrl(urlString)) {
      return fileGet(urlString);
    } else if (Protocol.isHttpUrl(urlString)) {
      return httpGet(urlString);
    } else if (Protocol.isFtpUrl(urlString)) {
      return ftpGet(urlString);
    } else if (Protocol.isLdapUrl(urlString)) {
      return ldapGet(urlString);
    } else {
      LOG.warn("DSS framework only supports HTTP, HTTPS, FTP and LDAP CRL's urlString.");
    }

    return httpGet(urlString);
  }