Ignore:
Timestamp:
May 2, 2018 3:39:14 AM (2 years ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
1c677cd
Parents:
c326bb7
Message:

Some changes, after much testing I find it best to spawn an sub java
process for I2P rather than trying to load Router via reflection or
anything runtime fancy stuff. Shell script is implemented in SBT now,
and can now link to download JRE script and so on.

Location:
launchers/common/src/main/scala/net/i2p/launchers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • launchers/common/src/main/scala/net/i2p/launchers/DeployProfile.scala

    rc326bb7 r70e994fc  
    11package net.i2p.launchers
    22
    3 import java.io.{File, InputStream}
     3import java.io.{File, IOException, InputStream}
     4import java.nio.file.FileAlreadyExistsException
    45
    56
     
    5960    * @return Unit
    6061    */
    61   def copyFileResToDisk(fStr: String) = Files.copy(
     62  def copyFileResToDisk(fStr: String) = try { Files.copy(
    6263    getClass.getResource("/".concat(fStr)).getContent.asInstanceOf[InputStream],
    6364    Paths.get(DeployProfile.pathJoin(confDir, fStr)).normalize()
    64   )
     65  )} catch {
     66    case _:FileAlreadyExistsException => {} // Ignored
     67    case ex:IOException => println(s"Error! Exception ${ex}")
     68  }
    6569
    6670
     
    7377    * @return Unit
    7478    */
    75   def copyBaseFileResToDisk(path: String, is: InputStream) = Files.copy(
     79  def copyBaseFileResToDisk(path: String, is: InputStream) = try { Files.copy(
    7680    is,
    7781    Paths.get(DeployProfile.pathJoin(baseDir, path)).normalize()
    78   )
     82  )} catch {
     83    case _:FileAlreadyExistsException => {} // Ignored
     84    case ex:IOException => println(s"Error! Exception ${ex}")
     85  }
    7986
    8087  /**
  • launchers/common/src/main/scala/net/i2p/launchers/OSXDeployment.scala

    rc326bb7 r70e994fc  
    138138      }
    139139    } catch {
     140      case _:FileAlreadyExistsException => {} // Ignored
    140141      case ex:IOException => println(s"Error! Exception ${ex}")
    141       case _:FileAlreadyExistsException => {} // Ignored
    142142    }
    143143  }
     
    167167        }
    168168      } catch {
     169        case _:FileAlreadyExistsException => {} // Ignored
    169170        case ex:IOException => println(s"Error! Exception ${ex}")
    170         case _:FileAlreadyExistsException => {} // Ignored
    171171      }
    172172    }
  • launchers/common/src/main/scala/net/i2p/launchers/RouterLauncher.scala

    rc326bb7 r70e994fc  
    11package net.i2p.launchers
    22
    3 import java.net.URL
     3import java.io.File
     4
    45
    56/**
     
    1011  */
    1112abstract class RouterLauncher {
    12 
    13   def getClassLoader: ClassLoader
    14 
    15   def addJarToClassPath(url: URL): Boolean
     13  def runRouter(basePath: File, args: Array[String]): Unit
    1614
    1715  def runRouter(args: Array[String]): Unit
Note: See TracChangeset for help on using the changeset viewer.