Class File

All Implemented Interfaces:
IAsset, ICatalog, IFile, IReferenceable, IResource, AuditDetail, Serializable, Comparable<Reference>

@Generated("com.atlan.generators.ModelGeneratorV2") public class File extends Asset implements IFile, IResource, ICatalog, IAsset, IReferenceable
Instance of a static file in Atlan.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • trimToReference

      public File trimToReference() throws InvalidRequestException
      Builds the minimal object necessary to create a relationship to a File, from a potentially more-complete File object.
      Overrides:
      trimToReference in class Asset
      Returns:
      the minimal object necessary to relate to the File
      Throws:
      InvalidRequestException - if any of the minimal set of required properties for a File relationship are not found in the initial object
    • select

      public static FluentSearch.FluentSearchBuilder<?,?> select()
      Start a fluent search that will return all File assets. Additional conditions can be chained onto the returned search before any asset retrieval is attempted, ensuring all conditions are pushed-down for optimal retrieval. Only active (non-archived) File assets will be included.
      Returns:
      a fluent search that includes all File assets
    • select

      public static FluentSearch.FluentSearchBuilder<?,?> select(AtlanClient client)
      Start a fluent search that will return all File assets. Additional conditions can be chained onto the returned search before any asset retrieval is attempted, ensuring all conditions are pushed-down for optimal retrieval. Only active (non-archived) File assets will be included.
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the assets
      Returns:
      a fluent search that includes all File assets
    • select

      public static FluentSearch.FluentSearchBuilder<?,?> select(boolean includeArchived)
      Start a fluent search that will return all File assets. Additional conditions can be chained onto the returned search before any asset retrieval is attempted, ensuring all conditions are pushed-down for optimal retrieval.
      Parameters:
      includeArchived - when true, archived (soft-deleted) Files will be included
      Returns:
      a fluent search that includes all File assets
    • select

      public static FluentSearch.FluentSearchBuilder<?,?> select(AtlanClient client, boolean includeArchived)
      Start a fluent search that will return all File assets. Additional conditions can be chained onto the returned search before any asset retrieval is attempted, ensuring all conditions are pushed-down for optimal retrieval.
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the assets
      includeArchived - when true, archived (soft-deleted) Files will be included
      Returns:
      a fluent search that includes all File assets
    • refByGuid

      public static File refByGuid(String guid)
      Reference to a File by GUID. Use this to create a relationship to this File, where the relationship should be replaced.
      Parameters:
      guid - the GUID of the File to reference
      Returns:
      reference to a File that can be used for defining a relationship to a File
    • refByGuid

      public static File refByGuid(String guid, Reference.SaveSemantic semantic)
      Reference to a File by GUID. Use this to create a relationship to this File, where you want to further control how that relationship should be updated (i.e. replaced, appended, or removed).
      Parameters:
      guid - the GUID of the File to reference
      semantic - how to save this relationship (replace all with this, append it, or remove it)
      Returns:
      reference to a File that can be used for defining a relationship to a File
    • refByQualifiedName

      public static File refByQualifiedName(String qualifiedName)
      Reference to a File by qualifiedName. Use this to create a relationship to this File, where the relationship should be replaced.
      Parameters:
      qualifiedName - the qualifiedName of the File to reference
      Returns:
      reference to a File that can be used for defining a relationship to a File
    • refByQualifiedName

      public static File refByQualifiedName(String qualifiedName, Reference.SaveSemantic semantic)
      Reference to a File by qualifiedName. Use this to create a relationship to this File, where you want to further control how that relationship should be updated (i.e. replaced, appended, or removed).
      Parameters:
      qualifiedName - the qualifiedName of the File to reference
      semantic - how to save this relationship (replace all with this, append it, or remove it)
      Returns:
      reference to a File that can be used for defining a relationship to a File
    • get

      public static File get(String id) throws AtlanException
      Retrieves a File by one of its identifiers, complete with all of its relationships.
      Parameters:
      id - of the File to retrieve, either its GUID or its full qualifiedName
      Returns:
      the requested full File, complete with all of its relationships
      Throws:
      AtlanException - on any error during the API invocation, such as the NotFoundException if the File does not exist or the provided GUID is not a File
    • get

      public static File get(AtlanClient client, String id) throws AtlanException
      Retrieves a File by one of its identifiers, complete with all of its relationships.
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the asset
      id - of the File to retrieve, either its GUID or its full qualifiedName
      Returns:
      the requested full File, complete with all of its relationships
      Throws:
      AtlanException - on any error during the API invocation, such as the NotFoundException if the File does not exist or the provided GUID is not a File
    • get

      public static File get(AtlanClient client, String id, boolean includeRelationships) throws AtlanException
      Retrieves a File by one of its identifiers, optionally complete with all of its relationships.
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the asset
      id - of the File to retrieve, either its GUID or its full qualifiedName
      includeRelationships - if true, all of the asset's relationships will also be retrieved; if false, no relationships will be retrieved
      Returns:
      the requested full File, optionally complete with all of its relationships
      Throws:
      AtlanException - on any error during the API invocation, such as the NotFoundException if the File does not exist or the provided GUID is not a File
    • restore

      public static boolean restore(String qualifiedName) throws AtlanException
      Restore the archived (soft-deleted) File to active.
      Parameters:
      qualifiedName - for the File
      Returns:
      true if the File is now active, and false otherwise
      Throws:
      AtlanException - on any API problems
    • restore

      public static boolean restore(AtlanClient client, String qualifiedName) throws AtlanException
      Restore the archived (soft-deleted) File to active.
      Parameters:
      client - connectivity to the Atlan tenant on which to restore the asset
      qualifiedName - for the File
      Returns:
      true if the File is now active, and false otherwise
      Throws:
      AtlanException - on any API problems
    • creator

      public static File.FileBuilder<?,?> creator(String name, String connectionQualifiedName, FileType type)
      Builds the minimal object necessary to create a File.
      Parameters:
      name - of the File (if multiple files with the same name exist in the connection, also include the path that makes this file unique)
      connectionQualifiedName - unique name of the connection in which the file is contained
      type - of the File
      Returns:
      the minimal request necessary to update the File, as a builder
    • generateQualifiedName

      public static String generateQualifiedName(String connectionQualifiedName, String name)
      Generate a unique File name.
      Parameters:
      connectionQualifiedName - unique name of the connection in which the file is contained
      name - of the File (including any path details, if necessary to ensure this file is unique within the connection)
      Returns:
      a unique name for the File
    • updater

      public static File.FileBuilder<?,?> updater(String qualifiedName, String name)
      Builds the minimal object necessary to update a File.
      Parameters:
      qualifiedName - of the File
      name - of the File
      Returns:
      the minimal request necessary to update the File, as a builder
    • trimToRequired

      public File.FileBuilder<?,?> trimToRequired() throws InvalidRequestException
      Builds the minimal object necessary to apply an update to a File, from a potentially more-complete File object.
      Overrides:
      trimToRequired in class Asset
      Returns:
      the minimal object necessary to update the File, as a builder
      Throws:
      InvalidRequestException - if any of the minimal set of required properties for File are not found in the initial object
    • removeDescription

      public static File removeDescription(String qualifiedName, String name) throws AtlanException
      Remove the system description from a File.
      Parameters:
      qualifiedName - of the File
      name - of the File
      Returns:
      the updated File, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • removeDescription

      public static File removeDescription(AtlanClient client, String qualifiedName, String name) throws AtlanException
      Remove the system description from a File.
      Parameters:
      client - connectivity to the Atlan tenant on which to remove the asset's description
      qualifiedName - of the File
      name - of the File
      Returns:
      the updated File, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • removeUserDescription

      public static File removeUserDescription(String qualifiedName, String name) throws AtlanException
      Remove the user's description from a File.
      Parameters:
      qualifiedName - of the File
      name - of the File
      Returns:
      the updated File, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • removeUserDescription

      public static File removeUserDescription(AtlanClient client, String qualifiedName, String name) throws AtlanException
      Remove the user's description from a File.
      Parameters:
      client - connectivity to the Atlan tenant on which to remove the asset's description
      qualifiedName - of the File
      name - of the File
      Returns:
      the updated File, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • removeOwners

      public static File removeOwners(String qualifiedName, String name) throws AtlanException
      Remove the owners from a File.
      Parameters:
      qualifiedName - of the File
      name - of the File
      Returns:
      the updated File, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • removeOwners

      public static File removeOwners(AtlanClient client, String qualifiedName, String name) throws AtlanException
      Remove the owners from a File.
      Parameters:
      client - connectivity to the Atlan tenant from which to remove the File's owners
      qualifiedName - of the File
      name - of the File
      Returns:
      the updated File, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • updateCertificate

      public static File updateCertificate(String qualifiedName, CertificateStatus certificate, String message) throws AtlanException
      Update the certificate on a File.
      Parameters:
      qualifiedName - of the File
      certificate - to use
      message - (optional) message, or null if no message
      Returns:
      the updated File, or null if the update failed
      Throws:
      AtlanException - on any API problems
    • updateCertificate

      public static File updateCertificate(AtlanClient client, String qualifiedName, CertificateStatus certificate, String message) throws AtlanException
      Update the certificate on a File.
      Parameters:
      client - connectivity to the Atlan tenant on which to update the File's certificate
      qualifiedName - of the File
      certificate - to use
      message - (optional) message, or null if no message
      Returns:
      the updated File, or null if the update failed
      Throws:
      AtlanException - on any API problems
    • removeCertificate

      public static File removeCertificate(String qualifiedName, String name) throws AtlanException
      Remove the certificate from a File.
      Parameters:
      qualifiedName - of the File
      name - of the File
      Returns:
      the updated File, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • removeCertificate

      public static File removeCertificate(AtlanClient client, String qualifiedName, String name) throws AtlanException
      Remove the certificate from a File.
      Parameters:
      client - connectivity to the Atlan tenant from which to remove the File's certificate
      qualifiedName - of the File
      name - of the File
      Returns:
      the updated File, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • updateAnnouncement

      public static File updateAnnouncement(String qualifiedName, AtlanAnnouncementType type, String title, String message) throws AtlanException
      Update the announcement on a File.
      Parameters:
      qualifiedName - of the File
      type - type of announcement to set
      title - (optional) title of the announcement to set (or null for no title)
      message - (optional) message of the announcement to set (or null for no message)
      Returns:
      the result of the update, or null if the update failed
      Throws:
      AtlanException - on any API problems
    • updateAnnouncement

      public static File updateAnnouncement(AtlanClient client, String qualifiedName, AtlanAnnouncementType type, String title, String message) throws AtlanException
      Update the announcement on a File.
      Parameters:
      client - connectivity to the Atlan tenant on which to update the File's announcement
      qualifiedName - of the File
      type - type of announcement to set
      title - (optional) title of the announcement to set (or null for no title)
      message - (optional) message of the announcement to set (or null for no message)
      Returns:
      the result of the update, or null if the update failed
      Throws:
      AtlanException - on any API problems
    • removeAnnouncement

      public static File removeAnnouncement(String qualifiedName, String name) throws AtlanException
      Remove the announcement from a File.
      Parameters:
      qualifiedName - of the File
      name - of the File
      Returns:
      the updated File, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • removeAnnouncement

      public static File removeAnnouncement(AtlanClient client, String qualifiedName, String name) throws AtlanException
      Remove the announcement from a File.
      Parameters:
      client - connectivity to the Atlan client from which to remove the File's announcement
      qualifiedName - of the File
      name - of the File
      Returns:
      the updated File, or null if the removal failed
      Throws:
      AtlanException - on any API problems
    • replaceTerms

      public static File replaceTerms(String qualifiedName, String name, List<IGlossaryTerm> terms) throws AtlanException
      Replace the terms linked to the File.
      Parameters:
      qualifiedName - for the File
      name - human-readable name of the File
      terms - the list of terms to replace on the File, or null to remove all terms from the File
      Returns:
      the File that was updated (note that it will NOT contain details of the replaced terms)
      Throws:
      AtlanException - on any API problems
    • replaceTerms

      public static File replaceTerms(AtlanClient client, String qualifiedName, String name, List<IGlossaryTerm> terms) throws AtlanException
      Replace the terms linked to the File.
      Parameters:
      client - connectivity to the Atlan tenant on which to replace the File's assigned terms
      qualifiedName - for the File
      name - human-readable name of the File
      terms - the list of terms to replace on the File, or null to remove all terms from the File
      Returns:
      the File that was updated (note that it will NOT contain details of the replaced terms)
      Throws:
      AtlanException - on any API problems
    • appendTerms

      public static File appendTerms(String qualifiedName, List<IGlossaryTerm> terms) throws AtlanException
      Link additional terms to the File, without replacing existing terms linked to the File. Note: this operation must make two API calls — one to retrieve the File's existing terms, and a second to append the new terms.
      Parameters:
      qualifiedName - for the File
      terms - the list of terms to append to the File
      Returns:
      the File that was updated (note that it will NOT contain details of the appended terms)
      Throws:
      AtlanException - on any API problems
    • appendTerms

      public static File appendTerms(AtlanClient client, String qualifiedName, List<IGlossaryTerm> terms) throws AtlanException
      Link additional terms to the File, without replacing existing terms linked to the File. Note: this operation must make two API calls — one to retrieve the File's existing terms, and a second to append the new terms.
      Parameters:
      client - connectivity to the Atlan tenant on which to append terms to the File
      qualifiedName - for the File
      terms - the list of terms to append to the File
      Returns:
      the File that was updated (note that it will NOT contain details of the appended terms)
      Throws:
      AtlanException - on any API problems
    • removeTerms

      public static File removeTerms(String qualifiedName, List<IGlossaryTerm> terms) throws AtlanException
      Remove terms from a File, without replacing all existing terms linked to the File. Note: this operation must make two API calls — one to retrieve the File's existing terms, and a second to remove the provided terms.
      Parameters:
      qualifiedName - for the File
      terms - the list of terms to remove from the File, which must be referenced by GUID
      Returns:
      the File that was updated (note that it will NOT contain details of the resulting terms)
      Throws:
      AtlanException - on any API problems
    • removeTerms

      public static File removeTerms(AtlanClient client, String qualifiedName, List<IGlossaryTerm> terms) throws AtlanException
      Remove terms from a File, without replacing all existing terms linked to the File. Note: this operation must make two API calls — one to retrieve the File's existing terms, and a second to remove the provided terms.
      Parameters:
      client - connectivity to the Atlan tenant from which to remove terms from the File
      qualifiedName - for the File
      terms - the list of terms to remove from the File, which must be referenced by GUID
      Returns:
      the File that was updated (note that it will NOT contain details of the resulting terms)
      Throws:
      AtlanException - on any API problems
    • appendAtlanTags

      public static File appendAtlanTags(String qualifiedName, List<String> atlanTagNames) throws AtlanException
      Add Atlan tags to a File, without replacing existing Atlan tags linked to the File. Note: this operation must make two API calls — one to retrieve the File's existing Atlan tags, and a second to append the new Atlan tags.
      Parameters:
      qualifiedName - of the File
      atlanTagNames - human-readable names of the Atlan tags to add
      Returns:
      the updated File
      Throws:
      AtlanException - on any API problems
    • appendAtlanTags

      public static File appendAtlanTags(AtlanClient client, String qualifiedName, List<String> atlanTagNames) throws AtlanException
      Add Atlan tags to a File, without replacing existing Atlan tags linked to the File. Note: this operation must make two API calls — one to retrieve the File's existing Atlan tags, and a second to append the new Atlan tags.
      Parameters:
      client - connectivity to the Atlan tenant on which to append Atlan tags to the File
      qualifiedName - of the File
      atlanTagNames - human-readable names of the Atlan tags to add
      Returns:
      the updated File
      Throws:
      AtlanException - on any API problems
    • appendAtlanTags

      public static File appendAtlanTags(String qualifiedName, List<String> atlanTagNames, boolean propagate, boolean removePropagationsOnDelete, boolean restrictLineagePropagation) throws AtlanException
      Add Atlan tags to a File, without replacing existing Atlan tags linked to the File. Note: this operation must make two API calls — one to retrieve the File's existing Atlan tags, and a second to append the new Atlan tags.
      Parameters:
      qualifiedName - of the File
      atlanTagNames - human-readable names of the Atlan tags to add
      propagate - whether to propagate the Atlan tag (true) or not (false)
      removePropagationsOnDelete - whether to remove the propagated Atlan tags when the Atlan tag is removed from this asset (true) or not (false)
      restrictLineagePropagation - whether to avoid propagating through lineage (true) or do propagate through lineage (false)
      Returns:
      the updated File
      Throws:
      AtlanException - on any API problems
    • appendAtlanTags

      public static File appendAtlanTags(AtlanClient client, String qualifiedName, List<String> atlanTagNames, boolean propagate, boolean removePropagationsOnDelete, boolean restrictLineagePropagation) throws AtlanException
      Add Atlan tags to a File, without replacing existing Atlan tags linked to the File. Note: this operation must make two API calls — one to retrieve the File's existing Atlan tags, and a second to append the new Atlan tags.
      Parameters:
      client - connectivity to the Atlan tenant on which to append Atlan tags to the File
      qualifiedName - of the File
      atlanTagNames - human-readable names of the Atlan tags to add
      propagate - whether to propagate the Atlan tag (true) or not (false)
      removePropagationsOnDelete - whether to remove the propagated Atlan tags when the Atlan tag is removed from this asset (true) or not (false)
      restrictLineagePropagation - whether to avoid propagating through lineage (true) or do propagate through lineage (false)
      Returns:
      the updated File
      Throws:
      AtlanException - on any API problems
    • removeAtlanTag

      public static void removeAtlanTag(String qualifiedName, String atlanTagName) throws AtlanException
      Remove an Atlan tag from a File.
      Parameters:
      qualifiedName - of the File
      atlanTagName - human-readable name of the Atlan tag to remove
      Throws:
      AtlanException - on any API problems, or if the Atlan tag does not exist on the File
    • removeAtlanTag

      public static void removeAtlanTag(AtlanClient client, String qualifiedName, String atlanTagName) throws AtlanException
      Remove an Atlan tag from a File.
      Parameters:
      client - connectivity to the Atlan tenant from which to remove an Atlan tag from a File
      qualifiedName - of the File
      atlanTagName - human-readable name of the Atlan tag to remove
      Throws:
      AtlanException - on any API problems, or if the Atlan tag does not exist on the File
    • _internal

      public static File.FileBuilder<?,?> _internal()
    • toBuilder

      public File.FileBuilder<?,?> toBuilder()
      Overrides:
      toBuilder in class Reference
    • getApplicationContainer

      public IApplicationContainer getApplicationContainer()
      ApplicationContainer asset containing this Catalog asset.
      Specified by:
      getApplicationContainer in interface ICatalog
      Specified by:
      getApplicationContainer in interface IFile
      Specified by:
      getApplicationContainer in interface IResource
    • getAssetApplicationQualifiedName

      public String getAssetApplicationQualifiedName()
      Qualified name of the Application Container that contains this asset.
      Specified by:
      getAssetApplicationQualifiedName in interface ICatalog
      Specified by:
      getAssetApplicationQualifiedName in interface IFile
      Specified by:
      getAssetApplicationQualifiedName in interface IResource
    • getFileAssets

      public IAsset getFileAssets()
      TBC
      Specified by:
      getFileAssets in interface IFile
    • getFilePath

      public String getFilePath()
      URL giving the online location where the file can be accessed.
      Specified by:
      getFilePath in interface IFile
    • getFileType

      public FileType getFileType()
      Type (extension) of the file.
      Specified by:
      getFileType in interface IFile
    • getInputToAirflowTasks

      public SortedSet<IAirflowTask> getInputToAirflowTasks()
      Tasks to which this asset provides input.
      Specified by:
      getInputToAirflowTasks in interface ICatalog
      Specified by:
      getInputToAirflowTasks in interface IFile
      Specified by:
      getInputToAirflowTasks in interface IResource
    • getInputToProcesses

      public SortedSet<ILineageProcess> getInputToProcesses()
      Processes to which this asset provides input.
      Specified by:
      getInputToProcesses in interface ICatalog
      Specified by:
      getInputToProcesses in interface IFile
      Specified by:
      getInputToProcesses in interface IResource
    • getInputToSparkJobs

      public SortedSet<ISparkJob> getInputToSparkJobs()
      TBC
      Specified by:
      getInputToSparkJobs in interface ICatalog
      Specified by:
      getInputToSparkJobs in interface IFile
      Specified by:
      getInputToSparkJobs in interface IResource
    • getIsGlobal

      public Boolean getIsGlobal()
      Whether the resource is global (true) or not (false).
      Specified by:
      getIsGlobal in interface IFile
      Specified by:
      getIsGlobal in interface IResource
    • getLink

      public String getLink()
      URL to the resource.
      Specified by:
      getLink in interface IFile
      Specified by:
      getLink in interface IResource
    • getModelImplementedEntities

      public SortedSet<IModelEntity> getModelImplementedEntities()
      Entities implemented by this asset.
      Specified by:
      getModelImplementedEntities in interface ICatalog
      Specified by:
      getModelImplementedEntities in interface IFile
      Specified by:
      getModelImplementedEntities in interface IResource
    • getOutputFromAirflowTasks

      public SortedSet<IAirflowTask> getOutputFromAirflowTasks()
      Tasks from which this asset is output.
      Specified by:
      getOutputFromAirflowTasks in interface ICatalog
      Specified by:
      getOutputFromAirflowTasks in interface IFile
      Specified by:
      getOutputFromAirflowTasks in interface IResource
    • getOutputFromProcesses

      public SortedSet<ILineageProcess> getOutputFromProcesses()
      Processes from which this asset is produced as output.
      Specified by:
      getOutputFromProcesses in interface ICatalog
      Specified by:
      getOutputFromProcesses in interface IFile
      Specified by:
      getOutputFromProcesses in interface IResource
    • getOutputFromSparkJobs

      public SortedSet<ISparkJob> getOutputFromSparkJobs()
      TBC
      Specified by:
      getOutputFromSparkJobs in interface ICatalog
      Specified by:
      getOutputFromSparkJobs in interface IFile
      Specified by:
      getOutputFromSparkJobs in interface IResource
    • getReference

      public String getReference()
      Reference to the resource.
      Specified by:
      getReference in interface IFile
      Specified by:
      getReference in interface IResource
    • getResourceMetadata

      public Map<String,String> getResourceMetadata()
      Metadata of the resource.
      Specified by:
      getResourceMetadata in interface IFile
      Specified by:
      getResourceMetadata in interface IResource
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Asset
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class Asset
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Asset
    • toString

      public String toString()
      Description copied from class: AtlanObject
      Overrides:
      toString in class Asset
    • getTypeName

      public String getTypeName()
      Fixed typeName for Files.
      Specified by:
      getTypeName in interface AuditDetail
      Specified by:
      getTypeName in interface IAsset
      Specified by:
      getTypeName in interface ICatalog
      Specified by:
      getTypeName in interface IFile
      Specified by:
      getTypeName in interface IReferenceable
      Specified by:
      getTypeName in interface IResource
      Overrides:
      getTypeName in class Reference