org.apache.uima.fit.util

## Class CasIOUtil

- java.lang.Object
- - org.apache.uima.fit.util.CasIOUtil

- Deprecated.
  Since UIMA 2.9.0 the core class `CasIOUtils` should be used.

      @Deprecated
      public class CasIOUtil
      extends Object

  Convenience methods for loading and saving CAS to disk.

- - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `readCas(CAS aCas, File aFile)` Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
    `static void` | `readJCas(JCas aJCas, File aFile)` Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
    `static void` | `readXCas(CAS aCas, File aFile)` Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
    `static void` | `readXCas(JCas aJCas, File aFile)` Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
    `static void` | `readXmi(CAS aCas, File aFile)` Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
    `static void` | `readXmi(JCas aJCas, File aFile)` Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
    `static void` | `writeXCas(CAS aCas, File aFile)` Deprecated. Use `CasIOUtils.save(CAS, OutputStream, org.apache.uima.cas.SerialFormat)` with `SerialFormat.XCAS` instead.
    `static void` | `writeXCas(JCas aJCas, File aFile)` Deprecated. Use `CasIOUtils.save(CAS, OutputStream, org.apache.uima.cas.SerialFormat)` with `SerialFormat.XCAS` instead.
    `static void` | `writeXmi(CAS aCas, File aFile)` Deprecated. Use `CasIOUtils.save(CAS, OutputStream, org.apache.uima.cas.SerialFormat)` with `SerialFormat.XMI` instead.
    `static void` | `writeXmi(JCas aJCas, File aFile)` Deprecated. Use `CasIOUtils.save(CAS, OutputStream, org.apache.uima.cas.SerialFormat)` with `SerialFormat.XMI` instead.

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

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

- - ### Method Detail

    - #### readCas

          @Deprecated
          public static void readCas(CAS aCas,
                                                 File aFile)
                                          throws IOException

      Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
      This method loads the contents of an XMI or XCAS file into the given CAS. The file type is detected by the extension.
      Parameters:
        `aCas` - the target CAS
        `aFile` - the file to read from
      Throws:
        `IOException` - if there is a problem reading the file

    - #### readXmi

          @Deprecated
          public static void readXmi(CAS aCas,
                                                 File aFile)
                                          throws IOException

      Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
      Parameters:
        `aCas` - the target CAS
        `aFile` - the file to read from
      Throws:
        `IOException` - if there is a problem reading the file

    - #### writeXmi

          @Deprecated
          public static void writeXmi(CAS aCas,
                                                  File aFile)
                                           throws IOException

      Deprecated. Use `CasIOUtils.save(CAS, OutputStream, org.apache.uima.cas.SerialFormat)` with `SerialFormat.XMI` instead.
      Parameters:
        `aCas` - the source CAS
        `aFile` - the file to write to
      Throws:
        `IOException` - if there is a problem writing the file

    - #### readXCas

          @Deprecated
          public static void readXCas(CAS aCas,
                                                  File aFile)
                                           throws IOException

      Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
      Parameters:
        `aCas` - the target CAS
        `aFile` - the file to read from
      Throws:
        `IOException` - if there is a problem reading the file

    - #### writeXCas

          @Deprecated
          public static void writeXCas(CAS aCas,
                                                   File aFile)
                                            throws IOException

      Deprecated. Use `CasIOUtils.save(CAS, OutputStream, org.apache.uima.cas.SerialFormat)` with `SerialFormat.XCAS` instead.
      Parameters:
        `aCas` - the source CAS
        `aFile` - the file to write to
      Throws:
        `IOException` - if there is a problem writing the file

    - #### readJCas

          @Deprecated
          public static void readJCas(JCas aJCas,
                                                  File aFile)
                                           throws IOException

      Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
      This method loads the contents of an XMI or XCAS file into the given CAS. The file type is detected by the extension.
      Parameters:
        `aJCas` - the target JCas
        `aFile` - the file to read from
      Throws:
        `IOException` - if there is a problem reading the file

    - #### readXmi

          @Deprecated
          public static void readXmi(JCas aJCas,
                                                 File aFile)
                                          throws IOException

      Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
      Parameters:
        `aJCas` - the target JCas
        `aFile` - the file to read from
      Throws:
        `IOException` - if there is a problem reading the file

    - #### writeXmi

          @Deprecated
          public static void writeXmi(JCas aJCas,
                                                  File aFile)
                                           throws IOException

      Deprecated. Use `CasIOUtils.save(CAS, OutputStream, org.apache.uima.cas.SerialFormat)` with `SerialFormat.XMI` instead.
      Parameters:
        `aJCas` - the source JCas
        `aFile` - the file to write to
      Throws:
        `IOException` - if there is a problem writing the file

    - #### readXCas

          @Deprecated
          public static void readXCas(JCas aJCas,
                                                  File aFile)
                                           throws IOException

      Deprecated. Use `CasIOUtils.load(java.net.URL, CAS)` instead.
      Parameters:
        `aJCas` - the target JCas
        `aFile` - the file to read from
      Throws:
        `IOException` - if there is a problem reading the file

    - #### writeXCas

          @Deprecated
          public static void writeXCas(JCas aJCas,
                                                   File aFile)
                                            throws IOException

      Deprecated. Use `CasIOUtils.save(CAS, OutputStream, org.apache.uima.cas.SerialFormat)` with `SerialFormat.XCAS` instead.
      Parameters:
        `aJCas` - the source JCas
        `aFile` - the file to write to
      Throws:
        `IOException` - if there is a problem writing the file

Copyright © 2012–2021 The Apache Software Foundation. All rights reserved.