Skip to content

Commit

Permalink
LPS-25702 Apply logic to getLocalRepositoryImpl()
Browse files Browse the repository at this point in the history
  • Loading branch information
caorongjin authored and brianchandotcom committed Apr 10, 2012
1 parent a24dfaf commit b83bd2e
Showing 1 changed file with 12 additions and 7 deletions.
Expand Up @@ -196,6 +196,14 @@ public LocalRepository getLocalRepositoryImpl(
long repositoryEntryId = getRepositoryEntryId(
folderId, fileEntryId, fileVersionId);

if (repositoryEntryId == folderId) {
DLFolder dlFolder = dlFolderLocalService.fetchDLFolder(folderId);

if ((dlFolder != null) && dlFolder.isMountPoint()) {
return getLocalRepositoryImpl(dlFolder.getRepositoryId());
}
}

LocalRepository localRepositoryImpl =
_localRepositoriesByRepositoryEntryId.get(repositoryEntryId);

Expand Down Expand Up @@ -271,14 +279,11 @@ public com.liferay.portal.kernel.repository.Repository getRepositoryImpl(
long repositoryEntryId = getRepositoryEntryId(
folderId, fileEntryId, fileVersionId);

RepositoryEntry repositoryEntry =
repositoryEntryLocalService.fetchRepositoryEntry(repositoryEntryId);

if ((repositoryEntry == null) && (repositoryEntryId == folderId)) {
DLFolder folder = dlFolderLocalService.fetchDLFolder(folderId);
if (repositoryEntryId == folderId) {
DLFolder dlFolder = dlFolderLocalService.fetchDLFolder(folderId);

if ((folder != null) && folder.isMountPoint()) {
return getRepositoryImpl(folder.getRepositoryId());
if ((dlFolder != null) && dlFolder.isMountPoint()) {
return getRepositoryImpl(dlFolder.getRepositoryId());
}
}

Expand Down

0 comments on commit b83bd2e

Please sign in to comment.