Package jspecview.common
Class JSVFileManager
java.lang.Object
jspecview.common.JSVFileManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic voidstatic StringfixUTF(byte[] bytes) static StringIn the case of applet-based simulations with file names that involve mol=..., we want to abbreviate those names for displaystatic BufferedReaderstatic BufferedReadergetBufferedReaderForStringOrBytes(Object stringOrBytes) static BufferedReaderstatic StringgetFileAsString(String name) static StringgetFullPathName(String name) FileManager.classifyName follow this with .replace('\\','/') and Escape.escape() to match Jmol's file name instatic InputStreamgetInputStream(String name, boolean showMsg, byte[] postBytes) static StringgetJmolFilePath(String filePath) static StringgetResourceString(Object object, String name, String[] error) static StringgetSimulationFileData(String name, String type) static StringgetSimulationType(String filePath) static ObjectgetStreamAsBytes(BufferedInputStream bis, OC out) static StringgetTagName(String fileName) Returns a name that can be used as a tag, possibly abbreviated.static booleanbooleanisApplet()static booleanstatic booleanstatic booleanisZipFile(InputStream is) static StringpostByteArray(String fileName, byte[] bytes) static voidsetDocumentBase(JSViewer v, URL documentBase) static inturlTypeIndex(String name)
-
Field Details
-
SIMULATION_PROTOCOL
- See Also:
-
appletDocumentBase
-
jsDocumentBase
-
URL_LOCAL
public static final int URL_LOCAL- See Also:
-
-
Constructor Details
-
JSVFileManager
public JSVFileManager()
-
-
Method Details
-
isApplet
public boolean isApplet() -
getFileAsString
- Parameters:
name-- Returns:
- file as string
-
getBufferedReaderForInputStream
-
getBufferedReaderForStringOrBytes
-
getBufferedReaderFromName
- Throws:
Exception
-
getFullPathName
FileManager.classifyName follow this with .replace('\\','/') and Escape.escape() to match Jmol's file name in- Parameters:
name-- Returns:
- name
- Throws:
JSVException
-
isURL
-
urlTypeIndex
-
isLocal
-
getAbbrSimulationFileName
In the case of applet-based simulations with file names that involve mol=..., we want to abbreviate those names for display- Parameters:
name- actual path name to simulation- Returns:
- actual name or hashed name
-
getSimulationFileData
-
cachePut
-
cacheGet
-
isAB
-
isZipFile
- Throws:
JSVException
-
getStreamAsBytes
- Throws:
JSVException
-
postByteArray
-
fixUTF
-
getInputStream
public static InputStream getInputStream(String name, boolean showMsg, byte[] postBytes) throws JSVException - Throws:
JSVException
-
getResourceString
-
getJmolFilePath
-
getTagName
Returns a name that can be used as a tag, possibly abbreviated.- Parameters:
fileName-- Returns:
- actual or abbreviated file name
-
setDocumentBase
-
getSimulationType
-