public class InstrumentProfileReader extends Object
Use InstrumentProfileConnection
if support for streaming updates of instrument profiles is needed.
Constructor and Description |
---|
InstrumentProfileReader()
Creates instrument profile reader.
|
Modifier and Type | Method and Description |
---|---|
long |
getLastModified()
Returns last modification time (in milliseconds) from last
readFromFile(java.lang.String) operation
or zero if it is unknown. |
protected String |
intern(String value)
To be overridden in subclasses to allow
intern strings using pools
(like StringCache ) to reduce memory footprint. |
List<InstrumentProfile> |
read(InputStream in)
Reads and returns instrument profiles from specified stream.
|
List<InstrumentProfile> |
read(InputStream in,
String name)
Reads and returns instrument profiles from specified stream using specified name to select data compression format.
|
List<InstrumentProfile> |
readFromFile(String address)
Reads and returns instrument profiles from specified file.
|
List<InstrumentProfile> |
readFromFile(String address,
String user,
String password)
Reads and returns instrument profiles from specified address with a specified basic user and password credentials.
|
static String |
resolveSourceURL(String address)
Converts a specified string address specification into an URL that will be read by
readFromFile(java.lang.String) method using URLInputStream . |
public InstrumentProfileReader()
public long getLastModified()
readFromFile(java.lang.String)
operation
or zero if it is unknown.public List<InstrumentProfile> readFromFile(String address) throws IOException
Authentication information can be supplied to this method as part of URL user info
like "http://user:password@host:port/path/file.ipf"
.
This is a shortcut for
.
readFromFile
(address, null, null)
This operation updates lastModified
.
address
- URL of file to read fromInstrumentProfileFormatException
- if input stream does not conform to the Simple File FormatIOException
- If an I/O error occurspublic List<InstrumentProfile> readFromFile(String address, String user, String password) throws IOException
Specified user and password take precedence over authentication information that is supplied to this method
as part of URL user info like "http://user:password@host:port/path/file.ipf"
.
This operation updates lastModified
.
address
- URL of file to read from.user
- the user name (may be null).password
- the password (may be null).InstrumentProfileFormatException
- if input stream does not conform to the Simple File Format.IOException
- If an I/O error occurs.public static String resolveSourceURL(String address)
readFromFile(java.lang.String)
method using URLInputStream
.public List<InstrumentProfile> read(InputStream in, String name) throws IOException
InstrumentProfileFormatException
- if input stream does not conform to the Simple File FormatIOException
- If an I/O error occurspublic List<InstrumentProfile> read(InputStream in) throws IOException
InstrumentProfileFormatException
- if input stream does not conform to the Simple File FormatIOException
- If an I/O error occursprotected String intern(String value)
intern
strings using pools
(like StringCache
) to reduce memory footprint. Default implementation does nothing
(returns value itself).value
- string value to internCopyright © 2002-2020 Devexperts LLC. All Rights Reserved.