Package jspecview.common
Class JSVFileManager
java.lang.Object
jspecview.common.JSVFileManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
static void
static String
fixUTF
(byte[] bytes) static String
In the case of applet-based simulations with file names that involve mol=..., we want to abbreviate those names for displaystatic BufferedReader
static BufferedReader
getBufferedReaderForStringOrBytes
(Object stringOrBytes) static BufferedReader
getBufferedReaderFromName
(String name, String startCode) static String
getFileAsString
(String name) static String
getFullPathName
(String name) FileManager.classifyName follow this with .replace('\\','/') and Escape.escape() to match Jmol's file name instatic InputStream
getInputStream
(String name, boolean showMsg, byte[] postBytes) static String
getJmolFilePath
(String filePath) static String
getResourceString
(Object object, String name, String[] error) static String
getSimulationFileData
(String name, String type) static String
getSimulationType
(String filePath) static Object
getStreamAsBytes
(BufferedInputStream bis, OC out) static String
getTagName
(String fileName) Returns a name that can be used as a tag, possibly abbreviated.static boolean
boolean
isApplet()
static boolean
static boolean
static boolean
isZipFile
(InputStream is) static String
postByteArray
(String fileName, byte[] bytes) static void
setDocumentBase
(JSViewer v, URL documentBase) static int
urlTypeIndex
(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
public static BufferedReader getBufferedReaderFromName(String name, String startCode) throws Exception - 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
-