Documentation of 'jhplot.Web' Java class.
Web
jhplot

Class Web



  • public class Webextends Object
    Simple file downloader similar to Unix WGET. Use get(url,true) if you want to replace the existiong file. Use get(url) for downloading the file only if it does not exist on the local disk. It can also allows to load a jar file from the internet and attach it to the classpath.
    • Field Detail

      • fSep

        public static final String fSep
      • lSep

        public static final String lSep
    • Constructor Detail

      • Web

        public Web()
    • Method Detail

      • get

        public static jhplot.Web.WgetStatus get(String url)
        Download a file to the local disk. It assumes the current directory. If file exists locally, the file will not be overwritten.
        Parameters:
        url - input URL for download.
      • get

        public static jhplot.Web.WgetStatus get(String url,                                        boolean isOverwrite)
        Download a file to the local disk. It assumes the current directory.
        Parameters:
        url - input URL for download.
        isOverwrite - set to true if the local file need to be replaced from the web.
      • get

        public static jhplot.Web.WgetStatus get(String url,                                        String saveAsFile,                                        boolean isOverwrite)
        Download a file to the local disk.
        Parameters:
        url - input URL for download.
        saveAsFile - file name with the path where the file will be saved
        isOverwrite - set to true if the local file need to be replaced from the web.
      • load

        public static String load(String url2)
        Download a jar file from the web and attach to the classpath. The downloaded jar file will be located inside "lib/user" directory. The existing file will not trigger the download.
        Parameters:
        url2 - input URL of jar for download.
        Returns:
        string with the status.
      • load

        public static String load(String url2,                          boolean isOverwrite)
        Download a jar file from the web and attach to the classpath. The downloaded jar file will be located inside "lib/user" directory of the installation.
        Parameters:
        url2 - input URL of jar for download.
        isOwerwrite - true if the existing file needs to be replaced. Set to False if skip download in the case of existing file.
        Returns:
        string with the status.
      • load

        public static String load(String url2,                          String dir,                          boolean isOverwrite)
        Download a jar file from the web and attach to the classpath. The downloaded jar file will be located inside "dir" directory.
        Parameters:
        url2 - input URL of jar for download.
        dir - directory path where the jar file should be stored
        isOwerwrite - true if the existing file needs to be replaced. Set to False if skip download in the case of existing file.
        Returns:
        string with the status.
      • loadLibrary

        public static void loadLibrary(File jar)                        throws IOException
        Adds the supplied Java Archive library to java.class.path. This is benign if the library is already loaded.
        Parameters:
        jar - input file
        Throws:
        IOException
      • getCurrentPath

        public static String getCurrentPath()
        Return instalation path.
        Returns:
        installation path

DMelt 2.7 © DataMelt by jWork.ORG