Class BaseVFSConnectionDetails

java.lang.Object
org.pentaho.di.connections.vfs.BaseVFSConnectionDetails
All Implemented Interfaces:
ConnectionDetails, VFSConnectionDetails
Direct Known Subclasses:
OtherConnectionDetails

public abstract class BaseVFSConnectionDetails extends Object implements VFSConnectionDetails
A class to put common fields for all types of VFS Connection Details to avoid code duplication
  • Constructor Details

    • BaseVFSConnectionDetails

      public BaseVFSConnectionDetails()
  • Method Details

    • getBaRoles

      @NonNull public List<String> getBaRoles()
      Description copied from interface: VFSConnectionDetails
      Gets the list of roles with access to the connection from the Business Analytics product.

      Access control does not distinguish between types of access operations (such as read, write, delete). Access is granted to either all or none of the operations.

      Specified by:
      getBaRoles in interface VFSConnectionDetails
      Returns:
      A non-null list of roles.
    • getProperties

      public Map<String,String> getProperties()
      Description copied from interface: ConnectionDetails
      Gets props associated with this ConnectionDetails. Allows implementors to expose connection properties without requiring clients to have the implementation as a dependency.
      Specified by:
      getProperties in interface ConnectionDetails
    • isRootPathSupported

      public boolean isRootPathSupported()
      Gets if the VFS connection supports root path or not.
      Specified by:
      isRootPathSupported in interface VFSConnectionDetails
    • getRootPath

      public String getRootPath()
      Description copied from interface: VFSConnectionDetails
      Gets the root folder path of this VFS connection.

      The root folder path allows limiting the files exposed through a PVFS URL.

      The default interface implementation exists to ensure backward compatibility and returns null.

      Semantics of the Root Folder Path

      Assume a connection without a configured root folder path, connection-name. The general structure of a PVFS URL that resolves to a file in this connection is pvfs://(connection-name)/(rest-path). If the rest-path component is split in two parts, the root path and the remainder, the following form is achieved: pvfs://(connection-name)/(root-path)/(rest-rest-path).

      Assume a connection configured with the root folder path root-path, all other configurations equal, named connection-with-root-path. The same file would be exposed by a pvfs URL in which the root-path component is omitted: pvfs://(connection-with-root-path)/(rest-rest-path).

      Necessarily, the configured root path must identify a file of type folder.

      Files which are not descendant of a connection's root folder path cannot be identified/accessed using a pvfs URL. Folder segments of a pvfs URL cannot have the special names . or ...

      Syntax of the Root Folder Path

      The syntax of the root folder path is that of one or more folder names separated by a folder separator, /. For example, the following would be syntactically valid: my-vfs-bucket/my-folder. While a leading or a trailing folder separator should be tolerated, a normalized root folder path should have none.

      The value stored in this property is subject to variable substitution and thus may not conform to the syntax of a root folder path. The syntax is validated only after variable substitution is performed.

      Impact of Root Folder Path on Provider URLs

      While omitted from the pvfs URL, the root folder path is incorporated in the provider-specific (a.k.a. internal) URL, as a result of the conversion process from pvfs to provider URL. The root folder path is not a required component of provider URLs, and files which are not descendants of the root folder path are still resolvable. The root folder path is not a security feature, by itself.

      The general structure of a provider URL corresponding to the above pvfs URL is like: (scheme):// [(domain) /] [(root-path) /] [(rest-rest-path)]

      Where the scheme component is given by the ConnectionDetails.getType() property, and the domain component is given by the VFSConnectionDetails.getDomain() property.

      The provider URL structure for specific providers may vary from this general structure. However, the semantics of the root folder path property should be respected.

      Examples of pvfs and Provider URLs

      Given an S3 connection, with a configured root folder path of my-bucket/my-folder, the pvfs URL, pvfs://my-s3-connection/my-sub-folder/my-file, would convert to the provider URL, s3://my-bucket/my-folder/my-sub-folder/my-file.

      Given an HCP connection, with a configured root folder path of my-folder, and a configured domain of my-domain.com:3000,the pvfs URL, pvfs://my-hcp-connection/my-sub-folder/my-file, would convert to the provider URL, hcp://my-domain.com:3000/my-folder/my-sub-folder/my-file.

      Specified by:
      getRootPath in interface VFSConnectionDetails
      Returns:
      A non-empty root path, if any; null, otherwise.
      See Also:
    • setRootPath

      public void setRootPath(String rootPath)
      Description copied from interface: VFSConnectionDetails
      Sets the root folder path, given as a string.

      An empty root folder path value should be converted to null. Further syntax validation is performed only after variable substitution.

      The default interface implementation exists to ensure backward compatibility and does nothing.

      Specified by:
      setRootPath in interface VFSConnectionDetails
      Parameters:
      rootPath - The root path.
    • fillProperties

      protected void fillProperties(Map<String,String> props)
      Adds base/default properties to properties of connection instance.

      Parameters:
      props - The properties map