private Content getContentById( final ContentId contentId ) { try { return this.contentService.getById( contentId ); } catch ( final Exception e ) { return null; } }
private ByteSource getById( final ContentId key ) { try { return getAttachment( this.contentService.getById( key ), this.name ); } catch ( final ContentNotFoundException e ) { return null; } }
private AttachmentsMapper getById( final ContentId key ) { try { return convert( this.contentService.getById( key ) ); } catch ( final ContentNotFoundException e ) { return null; } }
private ContentMapper getById( final ContentId key ) { try { return convert( this.contentService.getById( key ) ); } catch ( final ContentNotFoundException e ) { return null; } }
private boolean deleteById( final ContentId id ) { try { final Content content = this.contentService.getById( id ); return deleteByPath( content.getPath() ); } catch ( final ContentNotFoundException e ) { return false; } }
private Content getExistingContent( final String key ) { try { if ( !key.startsWith( "/" ) ) { return this.contentService.getById( ContentId.from( key ) ); } else { return this.contentService.getByPath( ContentPath.from( key ) ); } } catch ( final ContentNotFoundException e ) { return null; } }
private Content getContent() { try { if ( this.key.startsWith( "/" ) ) { return this.contentService.getByPath( ContentPath.from( key ) ); } else { return this.contentService.getById( ContentId.from( key ) ); } } catch ( final ContentNotFoundException e ) { // Do nothing } return null; } }
private Content move( final ContentId sourceId, final ContentPath newPath ) { final MoveContentParams moveParams = MoveContentParams.create(). contentId( sourceId ). parentContentPath( newPath ). build(); final MoveContentsResult result = contentService.move( moveParams ); return contentService.getById( result.getMovedContents().first() ); }
final Content sourceContent = contentService.getById( sourceId ); sourcePath = sourceContent.getPath();