Klasse FileInfo

Alle implementierten Schnittstellen:
PointerInterface

public class FileInfo extends PropertyHolder
Stores information about a file system object referenced by a [iface@Gio.File].

Functionality for manipulating basic metadata for files. `GFileInfo`
implements methods for getting information that all files should
contain, and allows for manipulation of extended attributes.

See the [file attributes](file-attributes.html) document for more
information on how GIO handles file attributes.

To obtain a `GFileInfo` for a [iface@Gio.File], use
[method@Gio.File.query_info] (or its async variant). To obtain a `GFileInfo`
for a file input or output stream, use [method@Gio.FileInputStream.query_info]
or [method@Gio.FileOutputStream.query_info] (or their async variants).

To change the actual attributes of a file, you should then set the
attribute in the `GFileInfo` and call [method@Gio.File.set_attributes_from_info]
or [method@Gio.File.set_attributes_async] on a `GFile`.

However, not all attributes can be changed in the file. For instance,
the actual size of a file cannot be changed via [method@Gio.FileInfo.set_size].
You may call [method@Gio.File.query_settable_attributes] and
[method@Gio.File.query_writable_namespaces] to discover the settable attributes
of a particular file at runtime.

The direct accessors, such as [method@Gio.FileInfo.get_name], are slightly more
optimized than the generic attribute accessors, such as
[method@Gio.FileInfo.get_attribute_byte_string].This optimization will matter
only if calling the API in a tight loop.

It is an error to call these accessors without specifying their required file
attributes when creating the `GFileInfo`. Use
[method@Gio.FileInfo.has_attribute] or [method@Gio.FileInfo.list_attributes]
to check what attributes are specified for a `GFileInfo`.

[struct@Gio.FileAttributeMatcher] allows for searching through a `GFileInfo`
for attributes.

https://docs.gtk.org/gio/class.FileInfo.html

  • Konstruktordetails

    • FileInfo

      public FileInfo(PointerContainer pointer)
    • FileInfo

      public FileInfo()
      Creates a new file info structure.
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • clearStatus

      public void clearStatus()
      Clears the status information from @info.
    • copyInto

      public void copyInto(@Nonnull FileInfo dest_info)
      First clears all of the [GFileAttribute](file-attributes.html#file-attributes) of
      @dest_info, and then copies all of the file attributes from @src_info to @dest_info.
      Parameter:
      dest_info - destination to copy attributes to.
    • dup

      public FileInfo dup()
      Duplicates a file info structure.
      Gibt zurück:
      a duplicate #GFileInfo of @other.
    • getAccessDateTime

      public DateTime getAccessDateTime()
      Gets the access time of the current @info and returns it as a
      #GDateTime.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_TIME_ACCESS. If %G_FILE_ATTRIBUTE_TIME_ACCESS_USEC is
      provided, the resulting #GDateTime will additionally have microsecond
      precision.

      If nanosecond precision is needed, %G_FILE_ATTRIBUTE_TIME_ACCESS_NSEC must
      be queried separately using g_file_info_get_attribute_uint32().
      Gibt zurück:
      access time, or %NULL if unknown
    • getAttributeAsString

      public Str getAttributeAsString(@Nonnull Str attribute)
      Gets the value of an attribute, formatted as a string.
      This escapes things as needed to make the string valid
      UTF-8.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a UTF-8 string associated with the given @attribute, or %NULL if the attribute wasn’t set. When you're done with the string it must be freed with g_free().
    • getAttributeAsString

      public Str getAttributeAsString(String attribute)
      Gets the value of an attribute, formatted as a string.
      This escapes things as needed to make the string valid
      UTF-8.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a UTF-8 string associated with the given @attribute, or %NULL if the attribute wasn’t set. When you're done with the string it must be freed with g_free().
    • getAttributeBoolean

      public boolean getAttributeBoolean(@Nonnull Str attribute)
      Gets the value of a boolean attribute. If the attribute does not
      contain a boolean value, %FALSE will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      the boolean value contained within the attribute.
    • getAttributeBoolean

      public boolean getAttributeBoolean(String attribute)
      Gets the value of a boolean attribute. If the attribute does not
      contain a boolean value, %FALSE will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      the boolean value contained within the attribute.
    • getAttributeByteString

      public Str getAttributeByteString(@Nonnull Str attribute)
      Gets the value of a byte string attribute. If the attribute does
      not contain a byte string, %NULL will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      the contents of the @attribute value as a byte string, or %NULL otherwise.
    • getAttributeByteString

      public Str getAttributeByteString(String attribute)
      Gets the value of a byte string attribute. If the attribute does
      not contain a byte string, %NULL will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      the contents of the @attribute value as a byte string, or %NULL otherwise.
    • getAttributeFilePath

      public Str getAttributeFilePath(@Nonnull Str attribute)
      Gets the value of a byte string attribute as a file path.

      If the attribute does not contain a byte string, `NULL` will be returned.

      This function is meant to be used by language bindings that have specific
      handling for Unix paths.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      the contents of the @attribute value as a file path, or %NULL otherwise.
    • getAttributeFilePath

      public Str getAttributeFilePath(String attribute)
      Gets the value of a byte string attribute as a file path.

      If the attribute does not contain a byte string, `NULL` will be returned.

      This function is meant to be used by language bindings that have specific
      handling for Unix paths.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      the contents of the @attribute value as a file path, or %NULL otherwise.
    • getAttributeInt32

      public int getAttributeInt32(@Nonnull Str attribute)
      Gets a signed 32-bit integer contained within the attribute. If the
      attribute does not contain a signed 32-bit integer, or is invalid,
      0 will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a signed 32-bit integer from the attribute.
    • getAttributeInt32

      public int getAttributeInt32(String attribute)
      Gets a signed 32-bit integer contained within the attribute. If the
      attribute does not contain a signed 32-bit integer, or is invalid,
      0 will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a signed 32-bit integer from the attribute.
    • getAttributeInt64

      public long getAttributeInt64(@Nonnull Str attribute)
      Gets a signed 64-bit integer contained within the attribute. If the
      attribute does not contain a signed 64-bit integer, or is invalid,
      0 will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a signed 64-bit integer from the attribute.
    • getAttributeInt64

      public long getAttributeInt64(String attribute)
      Gets a signed 64-bit integer contained within the attribute. If the
      attribute does not contain a signed 64-bit integer, or is invalid,
      0 will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a signed 64-bit integer from the attribute.
    • getAttributeObject

      public Object getAttributeObject(@Nonnull Str attribute)
      Gets the value of a #GObject attribute. If the attribute does
      not contain a #GObject, %NULL will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a #GObject associated with the given @attribute, or %NULL otherwise.
    • getAttributeObject

      public Object getAttributeObject(String attribute)
      Gets the value of a #GObject attribute. If the attribute does
      not contain a #GObject, %NULL will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a #GObject associated with the given @attribute, or %NULL otherwise.
    • getAttributeStatus

      public int getAttributeStatus(@Nonnull Str attribute)
      Gets the attribute status for an attribute key.
      Parameter:
      attribute - a file attribute key
      Gibt zurück:
      a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
    • getAttributeStatus

      public int getAttributeStatus(String attribute)
      Gets the attribute status for an attribute key.
      Parameter:
      attribute - a file attribute key
      Gibt zurück:
      a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
    • getAttributeString

      public Str getAttributeString(@Nonnull Str attribute)
      Gets the value of a string attribute. If the attribute does
      not contain a string, %NULL will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
    • getAttributeString

      public Str getAttributeString(String attribute)
      Gets the value of a string attribute. If the attribute does
      not contain a string, %NULL will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
    • getAttributeStringv

      public Strs getAttributeStringv(@Nonnull Str attribute)
      Gets the value of a stringv attribute. If the attribute does
      not contain a stringv, %NULL will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
    • getAttributeStringv

      public Strs getAttributeStringv(String attribute)
      Gets the value of a stringv attribute. If the attribute does
      not contain a stringv, %NULL will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
    • getAttributeType

      public int getAttributeType(@Nonnull Str attribute)
      Gets the attribute type for an attribute key.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
    • getAttributeType

      public int getAttributeType(String attribute)
      Gets the attribute type for an attribute key.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
    • getAttributeUint32

      public int getAttributeUint32(@Nonnull Str attribute)
      Gets an unsigned 32-bit integer contained within the attribute. If the
      attribute does not contain an unsigned 32-bit integer, or is invalid,
      0 will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      an unsigned 32-bit integer from the attribute.
    • getAttributeUint32

      public int getAttributeUint32(String attribute)
      Gets an unsigned 32-bit integer contained within the attribute. If the
      attribute does not contain an unsigned 32-bit integer, or is invalid,
      0 will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      an unsigned 32-bit integer from the attribute.
    • getAttributeUint64

      public long getAttributeUint64(@Nonnull Str attribute)
      Gets a unsigned 64-bit integer contained within the attribute. If the
      attribute does not contain an unsigned 64-bit integer, or is invalid,
      0 will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a unsigned 64-bit integer from the attribute.
    • getAttributeUint64

      public long getAttributeUint64(String attribute)
      Gets a unsigned 64-bit integer contained within the attribute. If the
      attribute does not contain an unsigned 64-bit integer, or is invalid,
      0 will be returned.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      a unsigned 64-bit integer from the attribute.
    • getContentType

      public Str getContentType()
      Gets the file's content type.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
      Gibt zurück:
      a string containing the file's content type, or %NULL if unknown.
    • getCreationDateTime

      public DateTime getCreationDateTime()
      Gets the creation time of the current @info and returns it as a
      #GDateTime.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_TIME_CREATED. If %G_FILE_ATTRIBUTE_TIME_CREATED_USEC is
      provided, the resulting #GDateTime will additionally have microsecond
      precision.

      If nanosecond precision is needed, %G_FILE_ATTRIBUTE_TIME_CREATED_NSEC must
      be queried separately using g_file_info_get_attribute_uint32().
      Gibt zurück:
      creation time, or %NULL if unknown
    • getDeletionDate

      public DateTime getDeletionDate()
      Returns the #GDateTime representing the deletion date of the file, as
      available in %G_FILE_ATTRIBUTE_TRASH_DELETION_DATE. If the
      %G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, %NULL is returned.
      Gibt zurück:
      a #GDateTime, or %NULL.
    • getDisplayName

      public Str getDisplayName()
      Gets a display name for a file. This is guaranteed to always be set.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
      Gibt zurück:
      a string containing the display name.
    • getEditName

      public Str getEditName()
      Gets the edit name for a file.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
      Gibt zurück:
      a string containing the edit name.
    • getEtag

      public Str getEtag()
      Gets the [entity tag][iface@Gio.File#entity-tags] for a given
      #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_ETAG_VALUE.
      Gibt zurück:
      a string containing the value of the "etag:value" attribute.
    • getFileType

      public int getFileType()
      Gets a file's type (whether it is a regular file, symlink, etc).
      This is different from the file's content type, see g_file_info_get_content_type().

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_TYPE.
      Gibt zurück:
      a #GFileType for the given file.
    • getIcon

      public Icon getIcon()
      Gets the icon for a file.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_ICON.
      Gibt zurück:
      #GIcon for the given @info.
    • getIsBackup

      public boolean getIsBackup()
      Checks if a file is a backup file.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP.
      Gibt zurück:
      %TRUE if file is a backup file, %FALSE otherwise.
    • getIsHidden

      public boolean getIsHidden()
      Checks if a file is hidden.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
      Gibt zurück:
      %TRUE if the file is a hidden file, %FALSE otherwise.
    • getIsSymlink

      public boolean getIsSymlink()
      Checks if a file is a symlink.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
      Gibt zurück:
      %TRUE if the given @info is a symlink.
    • getModificationDateTime

      public DateTime getModificationDateTime()
      Gets the modification time of the current @info and returns it as a
      #GDateTime.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_TIME_MODIFIED. If %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC is
      provided, the resulting #GDateTime will additionally have microsecond
      precision.

      If nanosecond precision is needed, %G_FILE_ATTRIBUTE_TIME_MODIFIED_NSEC must
      be queried separately using g_file_info_get_attribute_uint32().
      Gibt zurück:
      modification time, or %NULL if unknown
    • getModificationTime

      @Deprecated public void getModificationTime(@Nonnull TimeVal result)
      Veraltet.
      Gets the modification time of the current @info and sets it
      in @result.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_TIME_MODIFIED. If %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC is
      provided it will be used too.
      Parameter:
      result - a #GTimeVal.
    • getName

      public Str getName()
      Gets the name for a file. This is guaranteed to always be set.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_NAME.
      Gibt zurück:
      a string containing the file name.
    • getSortOrder

      public int getSortOrder()
      Gets the value of the sort_order attribute from the #GFileInfo.
      See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
      Gibt zurück:
      a #gint32 containing the value of the "standard::sort_order" attribute.
    • getSymbolicIcon

      public Icon getSymbolicIcon()
      Gets the symbolic icon for a file.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
      Gibt zurück:
      #GIcon for the given @info.
    • getSymlinkTarget

      public Str getSymlinkTarget()
      Gets the symlink target for a given #GFileInfo.

      It is an error to call this if the #GFileInfo does not contain
      %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET.
      Gibt zurück:
      a string containing the symlink target.
    • hasAttribute

      public boolean hasAttribute(@Nonnull Str attribute)
      Checks if a file info structure has an attribute named @attribute.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
    • hasAttribute

      public boolean hasAttribute(String attribute)
      Checks if a file info structure has an attribute named @attribute.
      Parameter:
      attribute - a file attribute key.
      Gibt zurück:
      %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
    • hasNamespace

      public boolean hasNamespace(@Nonnull Str name_space)
      Checks if a file info structure has an attribute in the
      specified @name_space.
      Parameter:
      name_space - a file attribute namespace.
      Gibt zurück:
      %TRUE if @info has an attribute in @name_space, %FALSE otherwise.
    • hasNamespace

      public boolean hasNamespace(String name_space)
      Checks if a file info structure has an attribute in the
      specified @name_space.
      Parameter:
      name_space - a file attribute namespace.
      Gibt zurück:
      %TRUE if @info has an attribute in @name_space, %FALSE otherwise.
    • listAttributes

      public Strs listAttributes(@Nullable Str name_space)
      Lists the file info structure's attributes.
      Parameter:
      name_space - a file attribute key's namespace, or %NULL to list all attributes.
      Gibt zurück:
      a null-terminated array of strings of all of the possible attribute types for the given @name_space, or %NULL on error.
    • listAttributes

      public Strs listAttributes(String name_space)
      Lists the file info structure's attributes.
      Parameter:
      name_space - a file attribute key's namespace, or %NULL to list all attributes.
      Gibt zurück:
      a null-terminated array of strings of all of the possible attribute types for the given @name_space, or %NULL on error.
    • removeAttribute

      public void removeAttribute(@Nonnull Str attribute)
      Removes all cases of @attribute from @info if it exists.
      Parameter:
      attribute - a file attribute key.
    • removeAttribute

      public void removeAttribute(String attribute)
      Removes all cases of @attribute from @info if it exists.
      Parameter:
      attribute - a file attribute key.
    • setAccessDateTime

      public void setAccessDateTime(@Nonnull DateTime atime)
      Sets the %G_FILE_ATTRIBUTE_TIME_ACCESS and
      %G_FILE_ATTRIBUTE_TIME_ACCESS_USEC attributes in the file info to the
      given date/time value.

      %G_FILE_ATTRIBUTE_TIME_ACCESS_NSEC will be cleared.
      Parameter:
      atime - a #GDateTime.
    • setAttribute

      public void setAttribute(@Nonnull Str attribute, int type, @Nonnull Pointer value_p)
      Sets the @attribute to contain the given value, if possible. To unset the
      attribute, use %G_FILE_ATTRIBUTE_TYPE_INVALID for @type.
      Parameter:
      attribute - a file attribute key.
      type - a #GFileAttributeType
      value_p - pointer to the value
    • setAttribute

      public void setAttribute(String attribute, int type, @Nonnull Pointer value_p)
      Sets the @attribute to contain the given value, if possible. To unset the
      attribute, use %G_FILE_ATTRIBUTE_TYPE_INVALID for @type.
      Parameter:
      attribute - a file attribute key.
      type - a #GFileAttributeType
      value_p - pointer to the value
    • setAttributeBoolean

      public void setAttributeBoolean(@Nonnull Str attribute, boolean attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - a boolean value.
    • setAttributeBoolean

      public void setAttributeBoolean(String attribute, boolean attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - a boolean value.
    • setAttributeByteString

      public void setAttributeByteString(@Nonnull Str attribute, @Nonnull Str attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - a byte string.
    • setAttributeByteString

      public void setAttributeByteString(String attribute, String attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - a byte string.
    • setAttributeFilePath

      public void setAttributeFilePath(@Nonnull Str attribute, @Nonnull Str attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.

      This function is meant to be used by language bindings that have specific
      handling for Unix paths.
      Parameter:
      attribute - a file attribute key.
      attr_value - a file path.
    • setAttributeFilePath

      public void setAttributeFilePath(String attribute, String attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.

      This function is meant to be used by language bindings that have specific
      handling for Unix paths.
      Parameter:
      attribute - a file attribute key.
      attr_value - a file path.
    • setAttributeInt32

      public void setAttributeInt32(@Nonnull Str attribute, int attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - a signed 32-bit integer
    • setAttributeInt32

      public void setAttributeInt32(String attribute, int attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - a signed 32-bit integer
    • setAttributeInt64

      public void setAttributeInt64(@Nonnull Str attribute, long attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - attribute name to set.
      attr_value - int64 value to set attribute to.
    • setAttributeInt64

      public void setAttributeInt64(String attribute, long attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - attribute name to set.
      attr_value - int64 value to set attribute to.
    • setAttributeMask

      public void setAttributeMask(@Nonnull FileAttributeMatcher mask)
      Sets @mask on @info to match specific attribute types.
      Parameter:
      mask - a #GFileAttributeMatcher.
    • setAttributeObject

      public void setAttributeObject(@Nonnull Str attribute, @Nonnull Object attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - a #GObject.
    • setAttributeObject

      public void setAttributeObject(String attribute, @Nonnull Object attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - a #GObject.
    • setAttributeStatus

      public boolean setAttributeStatus(@Nonnull Str attribute, int status)
      Sets the attribute status for an attribute key. This is only
      needed by external code that implement g_file_set_attributes_from_info()
      or similar functions.

      The attribute must exist in @info for this to work. Otherwise %FALSE
      is returned and @info is unchanged.
      Parameter:
      attribute - a file attribute key
      status - a #GFileAttributeStatus
      Gibt zurück:
      %TRUE if the status was changed, %FALSE if the key was not set.
    • setAttributeStatus

      public boolean setAttributeStatus(String attribute, int status)
      Sets the attribute status for an attribute key. This is only
      needed by external code that implement g_file_set_attributes_from_info()
      or similar functions.

      The attribute must exist in @info for this to work. Otherwise %FALSE
      is returned and @info is unchanged.
      Parameter:
      attribute - a file attribute key
      status - a #GFileAttributeStatus
      Gibt zurück:
      %TRUE if the status was changed, %FALSE if the key was not set.
    • setAttributeString

      public void setAttributeString(@Nonnull Str attribute, @Nonnull Str attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - a UTF-8 string.
    • setAttributeString

      public void setAttributeString(String attribute, String attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - a UTF-8 string.
    • setAttributeStringv

      public void setAttributeStringv(@Nonnull Str attribute, @Nonnull Strs attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.

      Sinze: 2.22
      Parameter:
      attribute - a file attribute key
      attr_value - a %NULL terminated array of UTF-8 strings.
    • setAttributeStringv

      public void setAttributeStringv(String attribute, @Nonnull Strs attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.

      Sinze: 2.22
      Parameter:
      attribute - a file attribute key
      attr_value - a %NULL terminated array of UTF-8 strings.
    • setAttributeUint32

      public void setAttributeUint32(@Nonnull Str attribute, int attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - an unsigned 32-bit integer.
    • setAttributeUint32

      public void setAttributeUint32(String attribute, int attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - an unsigned 32-bit integer.
    • setAttributeUint64

      public void setAttributeUint64(@Nonnull Str attribute, long attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - an unsigned 64-bit integer.
    • setAttributeUint64

      public void setAttributeUint64(String attribute, long attr_value)
      Sets the @attribute to contain the given @attr_value,
      if possible.
      Parameter:
      attribute - a file attribute key.
      attr_value - an unsigned 64-bit integer.
    • setContentType

      public void setContentType(@Nonnull Str content_type)
      Sets the content type attribute for a given #GFileInfo.
      See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
      Parameter:
      content_type - a [content type](content-types.html#content-types).
    • setContentType

      public void setContentType(String content_type)
      Sets the content type attribute for a given #GFileInfo.
      See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
      Parameter:
      content_type - a [content type](content-types.html#content-types).
    • setCreationDateTime

      public void setCreationDateTime(@Nonnull DateTime creation_time)
      Sets the %G_FILE_ATTRIBUTE_TIME_CREATED and
      %G_FILE_ATTRIBUTE_TIME_CREATED_USEC attributes in the file info to the
      given date/time value.

      %G_FILE_ATTRIBUTE_TIME_CREATED_NSEC will be cleared.
      Parameter:
      creation_time - a #GDateTime.
    • setDisplayName

      public void setDisplayName(@Nonnull Str display_name)
      Sets the display name for the current #GFileInfo.
      See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
      Parameter:
      display_name - a string containing a display name.
    • setDisplayName

      public void setDisplayName(String display_name)
      Sets the display name for the current #GFileInfo.
      See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
      Parameter:
      display_name - a string containing a display name.
    • setEditName

      public void setEditName(@Nonnull Str edit_name)
      Sets the edit name for the current file.
      See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
      Parameter:
      edit_name - a string containing an edit name.
    • setEditName

      public void setEditName(String edit_name)
      Sets the edit name for the current file.
      See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
      Parameter:
      edit_name - a string containing an edit name.
    • setFileType

      public void setFileType(int type)
      Sets the file type in a #GFileInfo to @type.
      See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
      Parameter:
      type - a #GFileType.
    • setIcon

      public void setIcon(@Nonnull Icon icon)
      Sets the icon for a given #GFileInfo.
      See %G_FILE_ATTRIBUTE_STANDARD_ICON.
      Parameter:
      icon - a #GIcon.
    • setIsHidden

      public void setIsHidden(boolean is_hidden)
      Sets the "is_hidden" attribute in a #GFileInfo according to @is_hidden.
      See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
      Parameter:
      is_hidden - a #gboolean.
    • setIsSymlink

      public void setIsSymlink(boolean is_symlink)
      Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
      See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
      Parameter:
      is_symlink - a #gboolean.
    • setModificationDateTime

      public void setModificationDateTime(@Nonnull DateTime mtime)
      Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED and
      %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC attributes in the file info to the
      given date/time value.

      %G_FILE_ATTRIBUTE_TIME_MODIFIED_NSEC will be cleared.
      Parameter:
      mtime - a #GDateTime.
    • setModificationTime

      @Deprecated public void setModificationTime(@Nonnull TimeVal mtime)
      Veraltet.
      Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED and
      %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC attributes in the file info to the
      given time value.

      %G_FILE_ATTRIBUTE_TIME_MODIFIED_NSEC will be cleared.
      Parameter:
      mtime - a #GTimeVal.
    • setName

      public void setName(@Nonnull Str name)
      Sets the name attribute for the current #GFileInfo.
      See %G_FILE_ATTRIBUTE_STANDARD_NAME.
      Parameter:
      name - a string containing a name.
    • setName

      public void setName(String name)
      Sets the name attribute for the current #GFileInfo.
      See %G_FILE_ATTRIBUTE_STANDARD_NAME.
      Parameter:
      name - a string containing a name.
    • setSortOrder

      public void setSortOrder(int sort_order)
      Sets the sort order attribute in the file info structure. See
      %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
      Parameter:
      sort_order - a sort order integer.
    • setSymbolicIcon

      public void setSymbolicIcon(@Nonnull Icon icon)
      Sets the symbolic icon for a given #GFileInfo.
      See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
      Parameter:
      icon - a #GIcon.
    • setSymlinkTarget

      public void setSymlinkTarget(@Nonnull Str symlink_target)
      Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
      to the given symlink target.
      Parameter:
      symlink_target - a static string containing a path to a symlink target.
    • setSymlinkTarget

      public void setSymlinkTarget(String symlink_target)
      Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
      to the given symlink target.
      Parameter:
      symlink_target - a static string containing a path to a symlink target.
    • unsetAttributeMask

      public void unsetAttributeMask()
      Unsets a mask set by g_file_info_set_attribute_mask(), if one
      is set.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()