Skip to content

Commit

Permalink
LPS-25970 DLStore expects a full filename when adding a file
Browse files Browse the repository at this point in the history
  • Loading branch information
danielreuther authored and Mate Thurzo committed Mar 22, 2012
1 parent 0c6c2c8 commit 0f1eac2
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -23,6 +23,7 @@
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.upgrade.UpgradeProcess;
import com.liferay.portal.kernel.util.FileUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.MimeTypesUtil;
import com.liferay.portal.kernel.util.PortalClassLoaderUtil;
import com.liferay.portal.kernel.util.StringBundler;
Expand Down Expand Up @@ -291,9 +292,11 @@ protected void migrateFile(
byte[] bytes = FileUtil.getBytes(is);

if (name == null) {
name = image.getImageId() + StringPool.PERIOD + image.getType();
name = GetterUtil.getString(image.getImageId());
}

name = name + StringPool.PERIOD + image.getType();

if (DLStoreUtil.hasFile(companyId, repositoryId, name)) {
DLStoreUtil.deleteFile(companyId, repositoryId, name);
}
Expand Down

0 comments on commit 0f1eac2

Please sign in to comment.