在这种情况下可以解决加密问题 [英] Can encryption be solution in this situation

查看:148
本文介绍了在这种情况下可以解决加密问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用EMC Documentum内容管理系统。我试图通过自己的API自动化一些文件导入(将文件移动到CMS存储库)。 (不要惊慌这个下一句,只是阅读它,因为它可以不知道EMC的自己的API)为此,我必须先创建一个类型为 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆