Examples of BucketFactory


Examples of com.splunk.shuttl.archiver.model.BucketFactory

  private static ThawBucketTransferer getThawBucketTransferer(
      ArchiveFileSystem archiveFileSystem,
      ThawLocationProvider thawLocationProvider) {
    ThawBucketTransferer thawBucketTransferer = new ThawBucketTransferer(
        thawLocationProvider, archiveFileSystem, new BucketFactory(),
        new TransactionExecuter());
    return thawBucketTransferer;
  }
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.BucketFactory

  /**
   * @return {@link CsvImporter} with default construction logic.
   */
  public static CsvImporter create() {
    return new CsvImporter(new SplunkImportTool(), new ShellExecutor(
        Runtime.getRuntime()), new BucketFactory());
  }
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.BucketFactory

public class ShuttlBucketEndpointHelper {

  public static void shuttlBucket(String path, String index,
      ShuttlProvider shuttlProvider, ConfigProvider configProvider,
      BucketModifier bucketModifier, BucketLocker bucketLocker) {
    BucketFactory bucketFactory = new BucketFactory();
    ShuttlBucketEndpoint shuttlBucketEndpoint = new ShuttlBucketEndpoint(
        shuttlProvider, configProvider, bucketModifier, bucketFactory,
        bucketLocker);

    shuttlBucketEndpoint.shuttlBucket(path, index);
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.BucketFactory

  @BeforeMethod
  public void setUp() {
    SplunkImportTool importTool = new SplunkImportTool();
    ShellExecutor shellExecutor = new ShellExecutor(Runtime.getRuntime());
    integratedCsvImporter = new CsvImporter(importTool, shellExecutor,
        new BucketFactory());
    csvBucket = TUtilsBucket.createRealCsvBucket();
  }
View Full Code Here

Examples of freenet.support.api.BucketFactory

        }
       
        boolean disconnect = shouldDisconnectAfterHandled(split[2].equals("HTTP/1.0"), headers) || !container.enablePersistentConnections();

        boolean allowPost = container.allowPosts();
        BucketFactory bf = container.getBucketFactory();
       
        ToadletContextImpl ctx = new ToadletContextImpl(sock, headers, bf, pageMaker, container, userAlertManager, bookmarkManager, uri, container.generateUniqueID());
        ctx.shouldDisconnect = disconnect;
       
        /*
         * copy the data into a bucket now,
         * before we go into the redirect loop
         */
       
        Bucket data;

        boolean methodIsConfigurable = true;

        String slen = headers.get("content-length");

        if (METHODS_MUST_HAVE_DATA.contains(method)) {
          // <method> must have data
          methodIsConfigurable = false;
          if (slen == null) {
            ctx.shouldDisconnect = true;
            ctx.sendReplyHeaders(400, "Bad Request", null, null, -1);
            return;
          }
        } else if (METHODS_CANNOT_HAVE_DATA.contains(method)) {
          // <method> can not have data
          methodIsConfigurable = false;
          if (slen != null) {
            ctx.shouldDisconnect = true;
            ctx.sendReplyHeaders(400, "Bad Request", null, null, -1);
            return;
          }
        }

        if (slen != null) {
          long len;
          try {
            len = Integer.parseInt(slen);
            if(len < 0) throw new NumberFormatException("content-length less than 0");
          } catch (NumberFormatException e) {
            ctx.shouldDisconnect = true;
            ctx.sendReplyHeaders(400, "Bad Request", null, null, -1);
            return;
          }
          if(allowPost && ((!container.publicGatewayMode()) || ctx.isAllowedFullAccess())) {
            data = bf.makeBucket(len);
            BucketTools.copyFrom(data, is, len);
          } else {
            FileUtil.skipFully(is, len);
            if (method.equals("POST")) {
              ctx.sendMethodNotAllowed("POST", true);
View Full Code Here

Examples of freenet.support.api.BucketFactory

  public void testCompressException() throws IOException {

    byte[] uncompressedData = UNCOMPRESSED_DATA_1.getBytes();
    Bucket inBucket = new ArrayBucket(uncompressedData);
    BucketFactory factory = new ArrayBucketFactory();

    try {
      Compressor.COMPRESSOR_TYPE.BZIP2.compress(inBucket, factory, 32, 32);
    } catch (CompressionOutputSizeException e) {
      // expect this
View Full Code Here

Examples of freenet.support.api.BucketFactory

    return outBuf;
  }

  private byte[] doCompress(byte[] uncompressedData) throws IOException {
    Bucket inBucket = new ArrayBucket(uncompressedData);
    BucketFactory factory = new ArrayBucketFactory();
    Bucket outBucket = null;

    outBucket = Compressor.COMPRESSOR_TYPE.BZIP2.compress(inBucket, factory, 32768, 32768);

    InputStream in = null;
View Full Code Here

Examples of freenet.support.api.BucketFactory

  public void testCompressException() throws IOException {

    byte[] uncompressedData = UNCOMPRESSED_DATA_1.getBytes();
    Bucket inBucket = new ArrayBucket(uncompressedData);
    BucketFactory factory = new ArrayBucketFactory();

    try {
      Compressor.COMPRESSOR_TYPE.GZIP.compress(inBucket, factory, 32, 32);
    } catch (CompressionOutputSizeException e) {
      // expect this
View Full Code Here

Examples of freenet.support.api.BucketFactory

    return outBuf;
  }

  private byte[] doCompress(byte[] uncompressedData) throws IOException {
    Bucket inBucket = new ArrayBucket(uncompressedData);
    BucketFactory factory = new ArrayBucketFactory();
    Bucket outBucket = null;

    outBucket = Compressor.COMPRESSOR_TYPE.GZIP.compress(inBucket, factory, 32768, 32768);

    InputStream in = null;
View Full Code Here

Examples of freenet.support.api.BucketFactory

  public void testCompressException() throws IOException {

    byte[] uncompressedData = UNCOMPRESSED_DATA_1.getBytes();
    Bucket inBucket = new ArrayBucket(uncompressedData);
    BucketFactory factory = new ArrayBucketFactory();

    try {
      Compressor.COMPRESSOR_TYPE.LZMA_NEW.compress(inBucket, factory, 32, 32);
    } catch (CompressionOutputSizeException e) {
      // expect this
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.