Examples of SystemUtils


Examples of net.pms.io.SystemUtils

    return defaults.getTsmuxerNewPath();
  }

  @Override
  public String getVlcPath() {
    SystemUtils registry = PMS.get().getRegistry();
    if (registry.getVlcPath() != null) {
      String vlc = registry.getVlcPath();
      String version = registry.getVlcVersion();
      if (new File(vlc).exists() && version != null) {
        LOGGER.debug("Found VLC version " + version + " in Windows Registry: " + vlc);
        return vlc;
      }
    }
View Full Code Here

Examples of net.pms.io.SystemUtils

    private double doPing(int size) {
      // let's get that speed
      OutputParams op = new OutputParams(null);
      op.log = true;
      op.maxBufferSize = 1;
      SystemUtils sysUtil = PMS.get().getRegistry();
      final ProcessWrapperImpl pw = new ProcessWrapperImpl(sysUtil.getPingCommand(addr.getHostAddress(), 3, size), op, true, false);
      Runnable r = new Runnable() {
        @Override
        public void run() {
          try {
            Thread.sleep(3000);
          } catch (InterruptedException e) {
          }
          pw.stopProcess();
        }
      };

      Thread failsafe = new Thread(r, "SpeedStats Failsafe");
      failsafe.start();
      pw.runInSameThread();
      List<String> ls = pw.getOtherResults();
      double time = 0;
      int c = 0;
      String timeString;

      for (String line : ls) {
        timeString = sysUtil.parsePingLine(line);
        if (timeString == null) {
          continue;
        }
        try {
          time += Double.parseDouble(timeString);
View Full Code Here

Examples of net.pms.io.SystemUtils

    return defaults.getTsmuxerPath();
  }

  @Override
  public String getVlcPath() {
    SystemUtils registry = PMS.get().getRegistry();

    if (registry.getVlcPath() != null) {
      String vlc = registry.getVlcPath();
      String version = registry.getVlcVersion();

      if (new File(vlc).exists() && version != null) {
        logger.debug("Found VLC version " + version + " in Windows Registry: " + vlc);
        return vlc;
      }
View Full Code Here

Examples of net.pms.io.SystemUtils

      // let's get that speed
      OutputParams op = new OutputParams(null);
      op.log = true;
      op.maxBufferSize = 1;
      SystemUtils sysUtil = PMS.get().getRegistry();
      final ProcessWrapperImpl pw = new ProcessWrapperImpl(sysUtil.getPingCommand(addr.getHostAddress(), 3, 64000), op,
          true, false);
      Runnable r = new Runnable() {
        public void run() {
          try {
            Thread.sleep(2000);
View Full Code Here

Examples of org.apache.commons.lang.SystemUtils

     * @param file the file to be converted into an URL
     * @return URL
     * @throws java.net.MalformedURLException when error occurred
     */
    static URL toURL(File file) throws MalformedURLException {
        if (new SystemUtils().isJavaVersionAtLeast(JAVA_1_4)) {
            try {
                Method toURI = file.getClass().getMethod("toURI", (Class[]) null);
                Object uri = toURI.invoke(file, (Class[]) null);
                Method toURL = uri.getClass().getMethod("toURL", (Class[]) null);

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.