CopyOneFile (Lucene 10.5.0 replicator API)
Description: declaration: package: org.apache.lucene.replicator.nrt, class: CopyOneFile

Package 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
  Description
  `final long`
  `bytesToCopy`
  `final FileMetaData`
  `metaData`
  `final String`
  `name`
  `final String`
  `tmpName`

- ## Constructor Summary

  Constructors
  Constructor
  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

  Modifier and Type
  Method
  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 Details

  - ### name

    public final String name

  - ### tmpName

    public final String tmpName

  - ### metaData

    public final FileMetaData metaData

  - ### bytesToCopy

    public final long bytesToCopy

- ## Constructor Details

  - ### 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 Details

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    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()