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 String
PROTOCOL
static String
SCHEME
-
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 String
canonicalURL(String urlName)
Create the canonical form of the URL.void
close()
Close all resources (files, sockets, etc) associated with this file.String
getFileTypeDescription()
Get a human-readable description for this file type.String
getFileTypeId()
Get the file type id for the underlying data source.protected StructureDataIterator
getStructureIterator(Structure s, int bufferSize)
protected Array
readData(Variable v, Section section)
Do not call this directly, use Variable.read() !! Ranges must be filled (no nulls)static InputStream
sendQuery(HTTPSession session, String remoteURI, String query)
static void
setAllowCompression(boolean b)
static void
setDebugFlags(DebugFlags debugFlag)
long
writeToFile(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:NetcdfFile
Do not call this directly, use Variable.read() !! Ranges must be filled (no nulls)- Overrides:
readData
in classNetcdfFile
- Throws:
IOException
-
getStructureIterator
protected StructureDataIterator getStructureIterator(Structure s, int bufferSize)
- Overrides:
getStructureIterator
in classNetcdfFile
-
sendQuery
public static InputStream sendQuery(HTTPSession session, String remoteURI, String query) throws IOException
- Throws:
IOException
-
getFileTypeId
public String getFileTypeId()
Description copied from class:NetcdfFile
Get the file type id for the underlying data source.- Overrides:
getFileTypeId
in 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:NetcdfFile
Get a human-readable description for this file type.- Overrides:
getFileTypeDescription
in 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:NetcdfFile
Close 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceFileCacheable
- Overrides:
close
in classNetcdfFile
-
-