protected ContentCreateOptions newContentCreateOptions(DocumentMetadata meta){
  ContentCreateOptions opt=(ContentCreateOptions)options.clone();
  if (meta != null) {
    if (opt.getQuality() == 0) {
      opt.setQuality(meta.quality);
    }
    HashSet<String> colSet=new HashSet<String>(meta.collectionsList);
    if (opt.getCollections() != null) {
      for (      String s : opt.getCollections()) {
        colSet.add(s);
      }
    }
    opt.setCollections(colSet.toArray(new String[colSet.size()]));
    HashSet<ContentPermission> pSet=new HashSet<ContentPermission>(meta.permissionsList);
    if (opt.getPermissions() != null) {
      for (      ContentPermission p : opt.getPermissions()) {
        pSet.add(p);
      }
    }
    opt.setPermissions(pSet.toArray(new ContentPermission[pSet.size()]));
    opt.setMetadata(meta.meta);
  }
  return opt;
}

protected ContentCreateOptions newContentCreateOptions ( DocumentMetadata meta ) { ContentCreateOptions opt = ( ContentCreateOptions ) options . clone ( ) ; if ( meta != null ) { if ( opt . getQuality ( ) == 0 ) { opt . setQuality ( meta . quality ) ; } HashSet < String > colSet = new HashSet < String > ( meta . collectionsList ) ; if ( opt . getCollections ( ) != null ) { for ( String s : opt . getCollections ( ) ) { colSet . add ( s ) ; } } opt . setCollections ( colSet . toArray ( new String [ colSet . size ( ) ] ) ) ; HashSet < ContentPermission > pSet = new HashSet < ContentPermission > ( meta . permissionsList ) ; if ( opt . getPermissions ( ) != null ) { for ( ContentPermission p : opt . getPermissions ( ) ) { pSet . add ( p ) ; } } opt . setPermissions ( pSet . toArray ( new ContentPermission [ pSet . size ( ) ] ) ) ; opt . setMetadata ( meta . meta ) ; } return opt ; }
fetch the options information from conf and metadata , set to the field " options "
