[英]Create XML file on FTP server without creating physical file localy
So I want to make XML file on FTP server. 所以我想在FTP服务器上制作XML文件。 I know, that I can do it localy and later just upload it, but I want to make it without local physical file. 我知道,我可以在本地进行此操作,以后再上传即可,但是我想使其不包含本地物理文件。
My code to create it locally was: 我的本地创建代码是:
public class XMLFileMaker {
public void countryObjectsToXML(Employee emp, String path) throws JAXBException {
JAXBContext context = JAXBContext.newInstance(Employee.class);
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.setProperty("com.sun.xml.bind.xmlDeclaration", Boolean.FALSE);
marshaller.setProperty("com.sun.xml.bind.xmlHeaders", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
marshaller.marshal(emp, new File(path + File.separator + "Informations.xml"));
}
}
Somebody have any ideas how can I solve my problem? 有人有任何想法我该如何解决我的问题?
(Uploading CSV file I have like here: Uploading a csv file to ftp without creating a physical file locally But now I don't have idea how to upload XML :/) (我在这里上传CSV文件的方法是: 将CSV文件上传到ftp而不在本地创建物理文件,但是现在我不知道如何上传XML:/)
FTP is a file transfer protocol, you can move files on server but it does not support file creation. FTP是文件传输协议,可以在服务器上移动文件,但不支持文件创建。 for all available commands type "help" after ftp login. 对于所有可用命令,在ftp登录后键入“ help”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.