/** * Writes the given repository to the given ZIP-output stream. * * @param zipOutputStream the output stream that represents the ZipFile to be generated. * @param repository the repository that should be written. * @throws IOException if an IO error prevents the writing of the file. * @throws ContentIOException if a repository related IO error occurs. */ public static void writeToZipStream( final ZipOutputStream zipOutputStream, final Repository repository ) throws IOException, ContentIOException { writeLocation( repository.getRoot(), zipOutputStream ); }
public static String getBundleType( final Repository repository ) { if ( repository == null ) { throw new NullPointerException(); } try { final ContentEntity mimeTypeContentEntity = repository.getRoot().getEntry( "mimetype" ); if ( mimeTypeContentEntity instanceof ContentItem ) { final ContentItem mimeTypeItem = (ContentItem) mimeTypeContentEntity; final ByteArrayOutputStream bout = new ByteArrayOutputStream(); final InputStream in = mimeTypeItem.getInputStream(); try { IOUtils.getInstance().copyStreams( in, bout ); } finally { in.close(); } return bout.toString( "ASCII" ); } return null; } catch ( Exception e ) { return null; } }
ContentLocation node = repository.getRoot(); for ( int i = 0; i < length - 1; i++ ) { final String nameItem = name[ i ];
ContentLocation node = repository.getRoot(); for ( int i = 0; i < length - 1; i++ ) { final String nameItem = name[ i ];
ContentLocation node = repository.getRoot(); for ( int i = 0; i < length - 1; i++ ) { final String nameItem = name[ i ];
this.repository = repository; this.mainKey = mainKey; this.root = repository.getRoot(); final String identifier = (String) mainKey.getIdentifier(); final String[] name = RepositoryUtilities.split( identifier, "/" );