-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cc90e2
commit 4305836
Showing
7 changed files
with
72 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package nl.isaac.dotcms.excelreader.shared; | ||
|
||
import com.dotmarketing.beans.Host; | ||
import com.dotmarketing.beans.Identifier; | ||
import com.dotmarketing.business.APILocator; | ||
import com.dotmarketing.exception.DotDataException; | ||
import com.dotmarketing.exception.DotSecurityException; | ||
import com.dotmarketing.portlets.contentlet.model.Contentlet; | ||
import com.dotmarketing.portlets.fileassets.business.FileAsset; | ||
import com.liferay.portal.model.User; | ||
|
||
public class FileTools { | ||
|
||
public static FileAsset getFileAssetByURI(String URI, Host host, boolean isLive) { | ||
try { | ||
User systemUser = APILocator.getUserAPI().getSystemUser(); | ||
long defaultLanguage = APILocator.getLanguageAPI().getDefaultLanguage().getId(); | ||
|
||
Identifier identifier = APILocator.getIdentifierAPI().find(host, URI); | ||
Contentlet fileContentlet = APILocator.getContentletAPI().findContentletByIdentifier(identifier.getId(), isLive, defaultLanguage, systemUser, false ); | ||
|
||
return APILocator.getFileAssetAPI().fromContentlet(fileContentlet); | ||
} catch (DotSecurityException e) { | ||
throw new RuntimeException(e); | ||
} catch (DotDataException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters