ApacheVFSOutputHandler extends BaseOutputHandler { @Override public IContentItem getFileOutputContentItem() { String contentRef = getContentRef(); try { String contentName = getHandlerId().substring( 4 ) + ":" + contentRef; FileSystemManager fsManager = getFileSystemManager(); if ( fsManager == null ) { logError( Messages.getInstance().getString( "ApacheVFSOutputHandler.ERROR_0001_CANNOT_GET_VFSMGR" ) ); return null; } FileObject file = fsManager.resolveFile( contentName ); if ( file == null ) { logError( Messages.getInstance().getString( "ApacheVFSOutputHandler.ERROR_0002_CANNOT_GET_VF", contentName ) ); return null; } if ( !file.isWriteable() ) { logError( Messages.getInstance().getString( "ApacheVFSOutputHandler.ERROR_0003_CANNOT_WRITE", contentName ) ); return null; } FileContent fileContent = file.getContent(); if ( fileContent == null ) { logError( Messages.getInstance().getString( "ApacheVFSOutputHandler.ERROR_0004_CANNOT_GET_CTX", contentName ) ); return null; } OutputStream outputStream = fileContent.getOutputStream(); SimpleContentItem content = new SimpleContentItem( outputStream ); return content; } catch ( Throwable t ) { Logger.error( ApacheVFSOutputHandler.class.getName(), Messages.getInstance().getString( "ApacheVFSOutputHandler.ERROR_0005_CANNOT_GET_HANDLER", contentRef ), t ); } return null; }  @Override IContentItem getFileOutputContentItem();  }
@Test public void getOutputContentItemTest() { setupMockObjectsDefaults( CONTENT_NAME, true, true ); IContentItem contentItem = apacheVFSOutputHandler.getFileOutputContentItem(); assertNotNull( contentItem ); }