Interface ClipboardFormat

All Known Implementing Classes:
BuiltInClipboardFormat

public interface ClipboardFormat
A collection of supported clipboard formats.
  • Method Details

    • getName

      String getName()
      Returns the name of this format.
      Returns:
      The name of the format
    • getAliases

      Set<String> getAliases()
      Get a set of aliases.
      Returns:
      a set of aliases
    • getReader

      ClipboardReader getReader(InputStream inputStream) throws IOException
      Create a reader.
      Parameters:
      inputStream - the input stream
      Returns:
      a reader
      Throws:
      IOException - thrown on I/O error
    • getWriter

      ClipboardWriter getWriter(OutputStream outputStream) throws IOException
      Create a writer.
      Parameters:
      outputStream - the output stream
      Returns:
      a writer
      Throws:
      IOException - thrown on I/O error
    • isFormat

      default boolean isFormat(File file)
      Return whether the given file is of this format.
      Parameters:
      file - the file
      Returns:
      true if the given file is of this format
    • isFormat

      default boolean isFormat(InputStream inputStream)
      Return whether the given stream is of this format.
      Parameters:
      inputStream - The stream
      Returns:
      true if the given stream is of this format
      API Note:
      The caller is responsible for the following:
      • Closing the input stream
    • getPrimaryFileExtension

      String getPrimaryFileExtension()
      Get the file extension this format primarily uses.
      Returns:
      The primary file extension
    • getFileExtensions

      Set<String> getFileExtensions()
      Get the file extensions this format is commonly known to use. This should include getPrimaryFileExtension().
      Returns:
      The file extensions this format might be known by