Package ucar.nc2.stream
Class CdmRemote
- java.lang.Object
-
- ucar.nc2.NetcdfFile
-
- ucar.nc2.stream.CdmRemote
-
- All Implemented Interfaces:
Closeable,AutoCloseable,FileCacheable
public class CdmRemote extends NetcdfFile
A remote CDM dataset (extending NetcdfFile), using cdmremote protocol to communicate. Similar to Opendap in that it is a remote access protocol using indexed data access. Supports full CDM / netcdf-4 data model.- Since:
- Feb 7, 2009
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ucar.nc2.NetcdfFile
NetcdfFile.Builder<T extends NetcdfFile.Builder<T>>
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROTOCOLstatic StringSCHEME-
Fields inherited from class ucar.nc2.NetcdfFile
cache, dimensions, gattributes, id, iosp, IOSP_MESSAGE_ADD_RECORD_STRUCTURE, IOSP_MESSAGE_CONVERT_RECORD_STRUCTURE, IOSP_MESSAGE_GET_NETCDF_FILE_FORMAT, IOSP_MESSAGE_RANDOM_ACCESS_FILE, IOSP_MESSAGE_REMOVE_RECORD_STRUCTURE, location, rootGroup, title, variables
-
-
Constructor Summary
Constructors Constructor Description CdmRemote(InputStream is, String location)CdmRemote(String _remoteURI)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringcanonicalURL(String urlName)Create the canonical form of the URL.voidclose()Close all resources (files, sockets, etc) associated with this file.StringgetFileTypeDescription()Get a human-readable description for this file type.StringgetFileTypeId()Get the file type id for the underlying data source.protected StructureDataIteratorgetStructureIterator(Structure s, int bufferSize)protected ArrayreadData(Variable v, Section section)Do not call this directly, use Variable.read() !! Ranges must be filled (no nulls)static InputStreamsendQuery(ucar.httpservices.HTTPSession session, String remoteURI, String query)static voidsetAllowCompression(boolean b)static voidsetDebugFlags(DebugFlags debugFlag)longwriteToFile(String filename)-
Methods inherited from class ucar.nc2.NetcdfFile
addAttribute, addAttribute, addDimension, addGroup, addLocalFieldsToBuilder, addStringVariable, addVariable, addVariable, addVariableAttribute, builder, canonicalizeUriString, canOpen, empty, findAttribute, findAttValueIgnoreCase, findDimension, findGlobalAttribute, findGlobalAttributeIgnoreCase, findGroup, findVariable, findVariable, findVariableByAttribute, finish, getCacheName, getDetailInfo, getDetailInfo, getDimensions, getFileTypeVersion, getGlobalAttributes, getId, getIosp, getLastModified, getLocation, getRootGroup, getTitle, getUnlimitedDimension, getVariables, hasUnlimitedDimension, iospDeRegister, iospRegistered, makeFullName, makeFullName, makeFullNameSectionSpec, makeFullNameWithString, makeNameUnescaped, makeRecordStructure, makeValidCDLName, makeValidCdmObjectName, makeValidPathName, makeValidSectionSpecName, open, open, open, open, open, open, openInMemory, openInMemory, openInMemory, openInMemory, reacquire, read, readArrays, readAttributeDouble, readAttributeInteger, readSection, readToByteChannel, readToOutputStream, registerIOProvider, registerIOProvider, registerIOProvider, registerIOProviderPreferred, release, removeDimension, removeRecordStructure, removeVariable, sendIospMessage, setCacheName, setFileCache, setId, setImmutable, setLocation, setProperty, setRootGroup, setTitle, showCached, showProxies, syncExtend, toBuilder, toNcml, toString, toStringDebug, writeCDL, writeCDL, writeCDL, writeNcml, writeNcml
-
-
-
-
Field Detail
-
PROTOCOL
public static final String PROTOCOL
- See Also:
- Constant Field Values
-
SCHEME
public static final String SCHEME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CdmRemote
public CdmRemote(String _remoteURI) throws IOException
- Throws:
IOException
-
CdmRemote
public CdmRemote(InputStream is, String location) throws IOException
- Throws:
IOException
-
-
Method Detail
-
setDebugFlags
public static void setDebugFlags(DebugFlags debugFlag)
-
setAllowCompression
public static void setAllowCompression(boolean b)
-
canonicalURL
public static String canonicalURL(String urlName)
Create the canonical form of the URL. If the urlName starts with "http:", change it to start with "cdmremote:", otherwise leave it alone.- Parameters:
urlName- the url string- Returns:
- canonical form
-
readData
protected Array readData(Variable v, Section section) throws IOException
Description copied from class:NetcdfFileDo not call this directly, use Variable.read() !! Ranges must be filled (no nulls)- Overrides:
readDatain classNetcdfFile- Throws:
IOException
-
getStructureIterator
protected StructureDataIterator getStructureIterator(Structure s, int bufferSize)
- Overrides:
getStructureIteratorin classNetcdfFile
-
sendQuery
public static InputStream sendQuery(ucar.httpservices.HTTPSession session, String remoteURI, String query) throws IOException
- Throws:
IOException
-
getFileTypeId
public String getFileTypeId()
Description copied from class:NetcdfFileGet the file type id for the underlying data source.- Overrides:
getFileTypeIdin classNetcdfFile- Returns:
- registered id of the file type
- See Also:
- "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
-
getFileTypeDescription
public String getFileTypeDescription()
Description copied from class:NetcdfFileGet a human-readable description for this file type.- Overrides:
getFileTypeDescriptionin classNetcdfFile- Returns:
- description of the file type
- See Also:
- "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
-
writeToFile
public long writeToFile(String filename) throws IOException
- Throws:
IOException
-
close
public void close()
Description copied from class:NetcdfFileClose all resources (files, sockets, etc) associated with this file. If the underlying file was acquired, it will be released, otherwise closed. if isClosed() already, nothing will happen- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceFileCacheable- Overrides:
closein classNetcdfFile
-
-