List of usage examples for com.liferay.portal.kernel.util FileUtil decodeSafeFileName
public static String decodeSafeFileName(String fileName)
From source file:com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.java
License:Open Source License
public String[] getFileNames(long companyId, long repositoryId) throws SystemException { String[] fileNames = _store.getFileNames(companyId, repositoryId); String[] decodedFileNames = new String[fileNames.length]; for (int i = 0; i < fileNames.length; i++) { decodedFileNames[i] = FileUtil.decodeSafeFileName(fileNames[i]); }//from w w w . j av a 2 s. co m return decodedFileNames; }
From source file:com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.java
License:Open Source License
public String[] getFileNames(long companyId, long repositoryId, String dirName) throws PortalException, SystemException { String safeDirName = FileUtil.encodeSafeFileName(dirName); if (!safeDirName.equals(dirName)) { try {//from www . j a v a2 s . c o m _store.move(dirName, safeDirName); } catch (Exception e) { } } String[] fileNames = _store.getFileNames(companyId, repositoryId, safeDirName); String[] decodedFileNames = new String[fileNames.length]; for (int i = 0; i < fileNames.length; i++) { decodedFileNames[i] = FileUtil.decodeSafeFileName(fileNames[i]); } return decodedFileNames; }