Class JSVFileManager

java.lang.Object
jspecview.common.JSVFileManager

public class JSVFileManager extends Object
  • Field Details

    • SIMULATION_PROTOCOL

      public static final String SIMULATION_PROTOCOL
      See Also:
    • appletDocumentBase

      public static URL appletDocumentBase
    • jsDocumentBase

      public static String jsDocumentBase
    • URL_LOCAL

      public static final int URL_LOCAL
      See Also:
  • Constructor Details

    • JSVFileManager

      public JSVFileManager()
  • Method Details

    • isApplet

      public boolean isApplet()
    • getFileAsString

      public static String getFileAsString(String name)
      Parameters:
      name -
      Returns:
      file as string
    • getBufferedReaderForInputStream

      public static BufferedReader getBufferedReaderForInputStream(InputStream in)
    • getBufferedReaderForStringOrBytes

      public static BufferedReader getBufferedReaderForStringOrBytes(Object stringOrBytes)
    • getBufferedReaderFromName

      public static BufferedReader getBufferedReaderFromName(String name, String startCode) throws Exception
      Throws:
      Exception
    • getFullPathName

      public static String getFullPathName(String name) throws JSVException
      FileManager.classifyName follow this with .replace('\\','/') and Escape.escape() to match Jmol's file name in
      Parameters:
      name -
      Returns:
      name
      Throws:
      JSVException
    • isURL

      public static boolean isURL(String name)
    • urlTypeIndex

      public static int urlTypeIndex(String name)
    • isLocal

      public static boolean isLocal(String fileName)
    • getAbbrSimulationFileName

      public static String getAbbrSimulationFileName(String name)
      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

      public static String getSimulationFileData(String name, String type)
    • cachePut

      public static void cachePut(String name, String data)
    • cacheGet

      public static String cacheGet(String key)
    • isAB

      public static boolean isAB(Object x)
    • isZipFile

      public static boolean isZipFile(InputStream is) throws JSVException
      Throws:
      JSVException
    • getStreamAsBytes

      public static Object getStreamAsBytes(BufferedInputStream bis, OC out) throws JSVException
      Throws:
      JSVException
    • postByteArray

      public static String postByteArray(String fileName, byte[] bytes)
    • fixUTF

      public static String fixUTF(byte[] bytes)
    • getInputStream

      public static InputStream getInputStream(String name, boolean showMsg, byte[] postBytes) throws JSVException
      Throws:
      JSVException
    • getResourceString

      public static String getResourceString(Object object, String name, String[] error)
    • getJmolFilePath

      public static String getJmolFilePath(String filePath)
    • getTagName

      public static String getTagName(String fileName)
      Returns a name that can be used as a tag, possibly abbreviated.
      Parameters:
      fileName -
      Returns:
      actual or abbreviated file name
    • setDocumentBase

      public static void setDocumentBase(JSViewer v, URL documentBase)
    • getSimulationType

      public static String getSimulationType(String filePath)