Package org.jcouchdb.util

Examples of org.jcouchdb.util.CouchDBUpdater


    return new CouchDatabase( uri, dbName, filters );
  }

  public void publishViews( @Nonnull String dbName ) throws URISyntaxException, IOException {
    CouchDBUpdater updater = new CouchDBUpdater();
    updater.setCreateDatabase( false );
    updater.setDatabase( new Database( server, dbName ) );

    try {
      URL resource = getViewResource();
      if ( resource == null ) {
        return;
      }
      File file = new File( resource.toURI() );
      File viewsDir = file.getParentFile().getParentFile();

      assertTrue( viewsDir.isDirectory() );
      updater.setDesignDocumentDir( viewsDir );

      updater.updateDesignDocuments();
    } catch ( CanceledException ignore ) {
    }
  }
View Full Code Here


    this.dbs.add( couchDatabase );
    return couchDatabase;
  }

  public void publishViews( @NotNull @NonNls String dbName ) throws URISyntaxException, IOException {
    CouchDBUpdater updater = new CouchDBUpdater();
    updater.setCreateDatabase( false );
    updater.setDatabase( new Database( server, dbName ) );

    try {
      URL resource = getViewResource();
      if ( resource == null ) {
        return;
      }
      File file = new File( resource.toURI() );
      File viewsDir = file.getParentFile().getParentFile();

      assertTrue( viewsDir.isDirectory() );
      updater.setDesignDocumentDir( viewsDir );

      updater.updateDesignDocuments();
    } catch ( CanceledException ignore ) {
    }
  }
View Full Code Here

    throw new ActionFailedExceptionSerializer().deserialize( response.getStatus(), response.getEntityInputStream() );
  }

  public void uploadViews( @Nonnull URL viewResource ) throws URISyntaxException, IOException {
    CouchDBUpdater updater = new CouchDBUpdater();
    updater.setCreateDatabase( false );
    updater.setDatabase( createInternalDb() );

    File file = new File( viewResource.toURI() );
    File viewsDir = file.getParentFile().getParentFile();

    assertTrue( viewsDir.isDirectory() );
    updater.setDesignDocumentDir( viewsDir );

    updater.updateDesignDocuments();
  }
View Full Code Here

TOP

Related Classes of org.jcouchdb.util.CouchDBUpdater

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.