Class PathDataSource

java.lang.Object
org.apache.commons.mail2.javax.activation.PathDataSource
All Implemented Interfaces:
DataSource

public final class PathDataSource extends Object implements DataSource
A JavaBeans Activation Framework DataSource that encapsulates a Path. It provides data typing services via a FileTypeMap object.
Since:
1.6.0
See Also:
  • Constructor Details

    • PathDataSource

      public PathDataSource(Path path)
      Creates a new instance from a Path.

      The file will not actually be opened until a method is called that requires the path to be opened.

      The type map defaults to FileTypeMap.getDefaultFileTypeMap().

      Parameters:
      path - the path
    • PathDataSource

      public PathDataSource(Path path, FileTypeMap typeMap, OpenOption... options)
      Creates a new instance from a Path.

      The file will not actually be opened until a method is called that requires the path to be opened.

      Parameters:
      path - the path, non-null.
      typeMap - the type map, non-null.
      options - options for opening file streams.
  • Method Details