Fórum

[URGENT] Best Liferay Directory to Store Private Files?

David Ilechukwu, modificado 11 Anos atrás.

[URGENT] Best Liferay Directory to Store Private Files?

Regular Member Postagens: 154 Data de Entrada: 07/06/10 Postagens Recentes
Ok guys,
Here's a quick one

My scenario is as follows:
I need to manually (not using Liferay http upload) upload a very confidential file (actually a company certificate keystore file) to my Liferay Server, such that:
The file should NEVER be accessible over http or https
File can only be accessed in code (say using a String pathToFile parameter).
Question is - where in Liferay (Tomcat Server) would be the best place to put such a sensitive file?

I'm aware that the default system used by Liferay for saving uploaded files can be specified in portal-ext.properties, using say:
dl.store.file.system.root.dir=${liferay.home}/data/document_library.

However, that would specify the default location for uploading files (and that would obviously be accessible over http).

Questions
(1) Where in Liferay Server directory hierarchy would be the best location to store such a file?
(2) How would I access such a file in Liferay (portlet) code?

Quick responses will be highly appreciated! emoticon

Thanks Guys!
thumbnail
jelmer kuperus, modificado 11 Anos atrás.

RE: [URGENT] Best Liferay Directory to Store Private Files?

Liferay Legend Postagens: 1191 Data de Entrada: 10/03/10 Postagens Recentes
dl.store.file.system.root.dir=${liferay.home}/data/document_library is not directly directly over http

It just holds the bytes of the files stored in the document library but those files cannot be retrieved unless a DlFileEntry exists in the database that points to it.

You should probably store your file under ${liferay.home}/data/whatever
David Ilechukwu, modificado 11 Anos atrás.

RE: [URGENT] Best Liferay Directory to Store Private Files?

Regular Member Postagens: 154 Data de Entrada: 07/06/10 Postagens Recentes
How do you I access a file stored in ${liferay.home}/datain my source code (seems to have skipped my mind).
Please show me a sample code snippet for doing that?

Also - what do you think about storing the file in my portlet-service.jar (seems a more distributed way of doing things)?
Many Thanks

jelmer kuperus:
dl.store.file.system.root.dir=${liferay.home}/data/document_library is not directly directly over http

It just holds the bytes of the files stored in the document library but those files cannot be retrieved unless a DlFileEntry exists in the database that points to it.

You should probably store your file under ${liferay.home}/data/whatever
thumbnail
Vilmos Papp, modificado 11 Anos atrás.

RE: [URGENT] Best Liferay Directory to Store Private Files?

Liferay Master Postagens: 529 Data de Entrada: 21/10/10 Postagens Recentes
Hi David,

You can assess it through Documents and Media services, but if you would be more specific about what type you would like to upload, how frequently you want to change it that would be helpful to find a proper solution.

Regards,
Vilmos
David Ilechukwu, modificado 11 Anos atrás.

RE: [URGENT] Best Liferay Directory to Store Private Files?

Regular Member Postagens: 154 Data de Entrada: 07/06/10 Postagens Recentes
Vilmos Papp:
Hi David,

You can assess it through Documents and Media services, but if you would be more specific about what type you would like to upload, how frequently you want to change it that would be helpful to find a proper solution.

Regards,
Vilmos


Thanks Vilmos -
(1) This file will not be uploaded to the portal - it is simply a file that will be copied into the Liferay data directory.
(2) The file is a certificate keystore (.pfx) - it is needed by the code that generates digital signatures

Hope this makes it clearer.
How do I access this file in code is the question (preferrably using a standard File object). What path would I put as the path to the file? Is it the full path (maybe C:/LiferayPortal/data/whatever) or is it some kind of alias url within Liferay such as /data/whatever/file.pfx

Thanks for quick response.
Regards
gofri _, modificado 11 Anos atrás.

RE: [URGENT] Best Liferay Directory to Store Private Files?

Junior Member Postagens: 92 Data de Entrada: 02/03/07 Postagens Recentes
You can use:
1. DLStoreUtil to access files in liferay data folder, skipping Document Library objects' creation, and thus accessing them only through Your code.
2. If You need more "low-level" logic, w/o using Liferay services, You can add file in some folder and point it in portal-ext.properties
thumbnail
Vilmos Papp, modificado 11 Anos atrás.

RE: [URGENT] Best Liferay Directory to Store Private Files?

Liferay Master Postagens: 529 Data de Entrada: 21/10/10 Postagens Recentes
Hi David,

I would create a custom Deployer implementation to deploy these type of files, which would move the file into a folder on the same level of document_library. If it's done, you can check how we access these files relatively and use the same pattern in your own code.

I hope it helps.

Regards,
Vilmos