@Urlencoded static ServiceType decodeLeadProtocol(String protocol) throws IOException { if (protocol.equals("dods")) return ServiceType.OPENDAP; else if (protocol.equals("dap4")) return ServiceType.DAP4; else if (protocol.equals(CdmRemote.PROTOCOL)) return ServiceType.CdmRemote; else if (protocol.equals(ThreddsDataFactory.PROTOCOL)) //thredds return ServiceType.THREDDS; return null; }
@Urlencoded static private ServiceType decodeLeadProtocol(String protocol) throws IOException { if (protocol.equals("dods")) return ServiceType.OPENDAP; else if (protocol.equals("dap4")) return ServiceType.DAP4; else if (protocol.equals("httpserver") || protocol.equals("nodods")) return ServiceType.HTTPServer; else if (protocol.equals(CdmRemote.PROTOCOL)) return ServiceType.CdmRemote; else if (protocol.equals(DataFactory.PROTOCOL)) //thredds return ServiceType.THREDDS; return null; }
/** * Get the content from a url. For large returns, its better to use getResponseAsStream. * * @param urlencoded url as a String * @return contents of url as a String * @throws java.io.IOException on error */ @Urlencoded public static String getContentAsString(String urlencoded) throws IOException { return getContentAsString(null,urlencoded); }
@Urlencoded static ServiceType disambiguateURL(String protocol, String location) throws IOException { if(protocol.equals("dods")) return ServiceType.OPENDAP; else if(protocol.equals("dap4")) return ServiceType.DAP4; else if(protocol.equals(CdmRemote.PROTOCOL)) return ServiceType.CdmRemote; else if(protocol.equals(ThreddsDataFactory.PROTOCOL)) //thredds return ServiceType.THREDDS; else if(protocol.equals("http") || protocol.equals("https")) return disambiguateHttp(location); // Actually contact the server return searchFragment(location); }
@Urlencoded static ServiceType disambiguateFile(String location)
@Urlencoded public HTTPRandomAccessFile(String url, int bufferSize) throws IOException { super(bufferSize);
@Urlencoded public HTTPRandomAccessFile(String url, int bufferSize) throws IOException { super(bufferSize);
@Urlencoded public HTTPRandomAccessFile(String url, int bufferSize) throws IOException { super(bufferSize);
@Urlencoded static private ServiceType disambiguateHttp(String location)
@Urlencoded static private ServiceType disambiguateHttp(String location)
/** * Get the content from a url. For large returns, its better to use getResponseAsStream. * * @param session use this session, if null, create a new one * @param urlencoded url as a String * @return contents of url as a String * @throws java.io.IOException on error */ @Urlencoded @Deprecated public static String getContentAsString(HTTPSession session, String urlencoded) throws IOException { HTTPSession useSession = session; try { if(useSession == null) useSession = new HTTPSession(); HTTPMethod m = HTTPMethod.Get(useSession); m.execute(urlencoded); return m.getResponseAsString(); } finally { if((session == null) && (useSession != null)) useSession.close(); } }
@Urlencoded static private ServiceType disambiguateHttp(String location) throws IOException { boolean checkDap2 = false, checkDap4 = false, checkCdmr = false;