try { libStream = resource.openStream(); outFile = new File(I2PAppContext.getGlobalContext().getTempDir(), filename); fos = new FileOutputStream(outFile); DataHelper.copy(libStream, fos);
try { libStream = resource.openStream(); outFile = new File(I2PAppContext.getGlobalContext().getTempDir(), filename); fos = new FileOutputStream(outFile); DataHelper.copy(libStream, fos);
/** * @param baseName generally "i2psnark" * @since Jetty 7 */ public I2PSnarkUtil(I2PAppContext ctx, String baseName) { _context = ctx; _log = _context.logManager().getLog(Snark.class); _baseName = baseName; _opts = new HashMap<String, String>(); //setProxy("127.0.0.1", 4444); setI2CPConfig("127.0.0.1", I2PClient.DEFAULT_LISTEN_PORT, null); _banlist = new ConcurrentHashSet<Hash>(); _maxUploaders = Snark.MAX_TOTAL_UPLOADERS; _maxUpBW = SnarkManager.DEFAULT_MAX_UP_BW; _maxConnections = MAX_CONNECTIONS; _startupDelay = DEFAULT_STARTUP_DELAY; _shouldUseOT = DEFAULT_USE_OPENTRACKERS; _openTrackers = Collections.emptyList(); _shouldUseDHT = DEFAULT_USE_DHT; _collapsePanels = DEFAULT_COLLAPSE_PANELS; _enableRatings = _enableComments = true; _commentsName = ""; // This is used for both announce replies and .torrent file downloads, // so it must be available even if not connected to I2CP. // so much for multiple instances _tmpDir = new SecureDirectory(ctx.getTempDir(), baseName + '-' + ctx.random().nextInt()); //FileUtil.rmdir(_tmpDir, false); _tmpDir.mkdirs(); }
System.err.println("Log directory: " + _logDir.getAbsolutePath()); System.err.println("PID directory: " + _pidDir.getAbsolutePath()); System.err.println("Temp directory: " + getTempDir().getAbsolutePath());
} else if (SystemVersion.isWindows()) { String[] browserString = new String[] { "C:\\Program Files\\Internet Explorer\\iexplore.exe", "-nohome", url }; File foo = new File(_context.getTempDir(), "browser" + _context.random().nextLong() + ".reg"); String[] args = new String[] { "regedit", "/E", foo.getAbsolutePath(), "HKEY_CLASSES_ROOT\\http\\shell\\open\\command" }; if (_log.shouldDebug()) _log.debug("Execute: " + Arrays.toString(args));
File tmp = null; try { tmp = SecureFile.createTempFile("addressbook", null, I2PAppContext.getGlobalContext().getTempDir()); EepGet get = new EepGet(I2PAppContext.getGlobalContext(), true, proxyHost, proxyPort, 0, -1l, MAX_SUB_SIZE, tmp.getAbsolutePath(), null,