List of usage examples for org.apache.commons.net.tftp.tftpserver TFTPServer setLogError
public void setLogError(PrintStream logError)
From source file:com.thesmartguild.firmloader.lib.tftp.TFTPServerFactory.java
public static TFTPServer instantiate(File file) { try {/*from w w w. j a v a 2 s.c om*/ TFTPServer TFTPServer_; Path tmpFilePath = TFTPServerFactory.createTempDirectory(); Path filePath = Files.copy(file.toPath(), Paths.get(tmpFilePath.toString(), file.getName()), StandardCopyOption.REPLACE_EXISTING); filePath.toFile().deleteOnExit(); TFTPServer_ = new TFTPServer(tmpFilePath.toFile(), tmpFilePath.toFile(), ServerMode.GET_ONLY); TFTPServer_.setLog(System.out); TFTPServer_.setLogError(System.out); return TFTPServer_; } catch (IOException e) { e.printStackTrace(); return null; } }