org.apache.lucene.replicator.nrt

## Class CopyOneFile

- java.lang.Object
- - org.apache.lucene.replicator.nrt.CopyOneFile

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class CopyOneFile
      extends Object
      implements Closeable

  Copies one file from an incoming DataInput to a dest filename in a local Directory

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `long` | `bytesToCopy`
    `FileMetaData` | `metaData`
    `String` | `name`
    `String` | `tmpName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CopyOneFile(CopyOneFile other, DataInput in)` Transfers this file copy to another input, continuing where the first one left off
    `CopyOneFile(DataInput in, ReplicaNode dest, String name, FileMetaData metaData, byte[] buffer)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `long` | `getBytesCopied()`
    `boolean` | `visit()` Copy another chunk of bytes, returning true once the copy is done

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### name

          public final String name

    - #### tmpName

          public final String tmpName

    - #### metaData

          public final FileMetaData metaData

    - #### bytesToCopy

          public final long bytesToCopy

  - ### Constructor Detail

    - #### CopyOneFile

          public CopyOneFile(DataInput in,
                             ReplicaNode dest,
                             String name,
                             FileMetaData metaData,
                             byte[] buffer)
                      throws IOException

      Throws:
        `IOException`

    - #### CopyOneFile

          public CopyOneFile(CopyOneFile other,
                             DataInput in)

      Transfers this file copy to another input, continuing where the first one left off

  - ### Method Detail

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

    - #### visit

          public boolean visit()
                        throws IOException

      Copy another chunk of bytes, returning true once the copy is done
      Throws:
        `IOException`

    - #### getBytesCopied

          public long getBytesCopied()

Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.