在这种情况下可以解决加密问题 [英] Can encryption be solution in this situation
问题描述
IDfFile
然后将该对象传递给执行导入的 IDfImportNode.add()
。 我想做的是在运行时从一个服务器获取文件,并立即执行导入操作。 我想在内存中执行所有这些操作,而不会将获取的文件保存在磁盘上 - 因为这些文件是机密的。
但问题是 IdfFile(string)
将要导入的文件的绝对路径。因此,文件必须存在于磁盘上,即使在导入后删除文件,磁盘上最终也会留下文件的痕迹。我猜测它是否可以采取 Stream
对象,但没有这样的超负荷。
所以我想知道如果我可以加密文件,然后保存到磁盘或任何其他方式。或者我要求EMC人员提供合适的API方法。
这样做的方法是使用 IDfSysObject.setContent()
方法。它将是更多的代码,因为您不能使用导入操作的便利,但它应该允许您保存流。也许这样的东西(但你已经有来自某处的流):
文件pdfInput =新文件(C:\\ \\\Rupinder\\MyFile.txt);
byte [] outBytes = new byte [(int)pdfInput.length()];
FileInputStream fileInputStream = new FileInputStream(pdfInput);
fileInputStream.read(outBytes);
ByteArrayOutputStream out = new ByteArrayOutputStream();
out.write(outBytes);
IDfSysObject sysObj =(IDfSysObject)session.newObject(c_pdf);
sysObj.setObjectName(testDoc);
sysObj.setContentType(crtext);
sysObj.setTitle(import operation);
sysObj.link(/ Temp / Source Folder);
sysObj.setContent(out);
sysObj.save();
来源: https://community.emc.com/message/98225
I am using a EMC Documentum content management system. I am trying to automate some file importing (moving files to CMS repository) with the help of their own API. (Dont panic by this next sentence, just read it, since its EMCs' own API that you may be unaware of) For that, I have to first create an object of type IDfFile
and then pass that object to IDfImportNode.add()
which performs importing.
What I want to do is to fetch the file at runtime from one server and immediately perform import operation. I want to do all this in-memory, without saving fetched files on the disk - since those files are confidential.
However the problem is that IdfFile(string)
takes absolute path of the file to be imported. So the file has to exist on the disk physically, which will eventually leave traces of files on disk even after I delete files after import. I was guessing if it can take Stream
object, but there is no such overload.
So I want to know if I can encrypt files before saving to disk or any other way out of it. Or that I request EMC people to provide suitable API method.
The way to do this is to use the IDfSysObject.setContent()
method. It is going to be more code, because you can't use the Import operation conveniences, but it should allow you to save a stream. Maybe something like this (but you would already have the stream from somewhere):
File pdfInput = new File("C:\\Rupinder\\MyFile.txt");
byte[] outBytes = new byte[(int)pdfInput.length()];
FileInputStream fileInputStream = new FileInputStream(pdfInput);
fileInputStream.read(outBytes);
ByteArrayOutputStream out = new ByteArrayOutputStream();
out.write(outBytes);
IDfSysObject sysObj = (IDfSysObject)session.newObject("c_pdf");
sysObj.setObjectName("testDoc");
sysObj.setContentType("crtext");
sysObj.setTitle("import operation");
sysObj.link("/Temp/Source Folder");
sysObj.setContent(out);
sysObj.save();
source: https://community.emc.com/message/98225
这篇关于在这种情况下可以解决加密问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!