List of usage examples for com.liferay.portal.kernel.util FileUtil encodeSafeFileName
public static String encodeSafeFileName(String fileName)
From source file:com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.java
License:Open Source License
public void updateFile(long companyId, long repositoryId, String fileName, String newFileName) throws PortalException, SystemException { String safeFileName = FileUtil.encodeSafeFileName(fileName); String safeNewFileName = FileUtil.encodeSafeFileName(newFileName); if (!safeFileName.equals(fileName)) { if (_store.hasFile(companyId, repositoryId, fileName, DLFileEntryConstants.VERSION_DEFAULT)) { safeFileName = fileName;//from ww w. j av a 2 s. co m } } _store.updateFile(companyId, repositoryId, safeFileName, safeNewFileName); }
From source file:com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.java
License:Open Source License
public void updateFile(long companyId, long repositoryId, String fileName, String versionLabel, byte[] bytes) throws PortalException, SystemException { String safeFileName = FileUtil.encodeSafeFileName(fileName); renameUnsafeFile(companyId, repositoryId, fileName, safeFileName); _store.updateFile(companyId, repositoryId, safeFileName, versionLabel, bytes); }
From source file:com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.java
License:Open Source License
public void updateFile(long companyId, long repositoryId, String fileName, String versionLabel, File file) throws PortalException, SystemException { String safeFileName = FileUtil.encodeSafeFileName(fileName); renameUnsafeFile(companyId, repositoryId, fileName, safeFileName); _store.updateFile(companyId, repositoryId, safeFileName, versionLabel, file); }
From source file:com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.java
License:Open Source License
public void updateFile(long companyId, long repositoryId, String fileName, String versionLabel, InputStream is) throws PortalException, SystemException { String safeFileName = FileUtil.encodeSafeFileName(fileName); renameUnsafeFile(companyId, repositoryId, fileName, safeFileName); _store.updateFile(companyId, repositoryId, safeFileName, versionLabel, is); }
From source file:com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.java
License:Open Source License
public void updateFileVersion(long companyId, long repositoryId, String fileName, String fromVersionLabel, String toVersionLabel) throws PortalException, SystemException { String safeFileName = FileUtil.encodeSafeFileName(fileName); renameUnsafeFile(companyId, repositoryId, fileName, safeFileName); _store.updateFileVersion(companyId, repositoryId, safeFileName, fromVersionLabel, toVersionLabel); }