Skip to content

Commit

Permalink
Issue #104 - type of connection test
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-stastny committed Jul 15, 2014
1 parent 611566e commit 61d6ca1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package cz.incad.kramerius.impl;

import com.google.inject.Inject;

import cz.incad.kramerius.*;
import cz.incad.kramerius.statistics.StatisticsAccessLog;
import cz.incad.kramerius.utils.FedoraUtils;
Expand All @@ -26,6 +27,7 @@
import cz.incad.kramerius.utils.conf.KConfiguration;
import cz.incad.kramerius.utils.pid.LexerException;
import cz.incad.kramerius.utils.pid.PIDParser;

import org.antlr.stringtemplate.StringTemplate;
import org.antlr.stringtemplate.StringTemplateGroup;
import org.antlr.stringtemplate.language.DefaultTemplateLexer;
Expand All @@ -37,9 +39,11 @@
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.ws.BindingProvider;
import javax.xml.xpath.*;

import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URLConnection;
import java.nio.charset.Charset;
import java.util.*;
import java.util.logging.Level;
Expand Down Expand Up @@ -876,7 +880,10 @@ public InputStream getDataStream(String pid, String datastreamName) throws IOExc
Element dsLocation = XMLUtils.findElement(datastreamProfile.getDocumentElement(), "dsLocation", FedoraNamespaces.FEDORA_MANAGEMENT_NAMESPACE_URI);
if (dsLocation != null) {
// no user, no pass
con = (HttpURLConnection) openConnection(dsLocation.getTextContent().trim(), "", "");
URLConnection directConnection = openConnection(dsLocation.getTextContent().trim(), "", "");
if (directConnection instanceof HttpURLConnection) {
con = (HttpURLConnection) directConnection;
}
}
}
}
Expand Down

0 comments on commit 61d6ca1

Please sign in to comment.