Package ch.bailu.gtk.gio
Class FileInfo
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gio.FileInfo
- All Implemented Interfaces:
PointerInterface
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 [GFileAttribute][gio-GFileAttribute] for more information on how
GIO handles file attributes.
To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
async variant). To obtain a #GFileInfo for a file input or output
stream, use g_file_input_stream_query_info() or
g_file_output_stream_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 g_file_set_attributes_from_info()
or g_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 g_file_info_set_size().
You may call g_file_query_settable_attributes() and
g_file_query_writable_namespaces() to discover the settable attributes
of a particular file at runtime.
The direct accessors, such as g_file_info_get_name(), are slightly more
optimized than the generic attribute accessors, such as
g_file_info_get_attribute_byte_string().This optimization will matter
only if calling the API in a tight loop.
#GFileAttributeMatcher allows for searching through a #GFileInfo for
attributes.
implements methods for getting information that all files should
contain, and allows for manipulation of extended attributes.
See [GFileAttribute][gio-GFileAttribute] for more information on how
GIO handles file attributes.
To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
async variant). To obtain a #GFileInfo for a file input or output
stream, use g_file_input_stream_query_info() or
g_file_output_stream_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 g_file_set_attributes_from_info()
or g_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 g_file_info_set_size().
You may call g_file_query_settable_attributes() and
g_file_query_writable_namespaces() to discover the settable attributes
of a particular file at runtime.
The direct accessors, such as g_file_info_get_name(), are slightly more
optimized than the generic attribute accessors, such as
g_file_info_get_attribute_byte_string().This optimization will matter
only if calling the API in a tight loop.
#GFileAttributeMatcher allows for searching through a #GFileInfo for
attributes.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionFileInfo()
Creates a new file info structure.FileInfo
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the status information from @info.void
First clears all of the [GFileAttribute][gio-GFileAttribute] of @dest_info,
and then copies all of the file attributes from @src_info to @dest_info.dup()
Duplicates a file info structure.Gets the access time of the current @info and returns it as a
#GDateTime.getAttributeAsString
(Str attribute) Gets the value of a attribute, formatted as a string.getAttributeAsString
(String attribute) Gets the value of a attribute, formatted as a string.boolean
getAttributeBoolean
(Str attribute) Gets the value of a boolean attribute.boolean
getAttributeBoolean
(String attribute) Gets the value of a boolean attribute.getAttributeByteString
(Str attribute) Gets the value of a byte string attribute.getAttributeByteString
(String attribute) Gets the value of a byte string attribute.int
getAttributeInt32
(Str attribute) Gets a signed 32-bit integer contained within the attribute.int
getAttributeInt32
(String attribute) Gets a signed 32-bit integer contained within the attribute.long
getAttributeInt64
(Str attribute) Gets a signed 64-bit integer contained within the attribute.long
getAttributeInt64
(String attribute) Gets a signed 64-bit integer contained within the attribute.getAttributeObject
(Str attribute) Gets the value of a #GObject attribute.getAttributeObject
(String attribute) Gets the value of a #GObject attribute.int
getAttributeStatus
(Str attribute) Gets the attribute status for an attribute key.int
getAttributeStatus
(String attribute) Gets the attribute status for an attribute key.getAttributeString
(Str attribute) Gets the value of a string attribute.getAttributeString
(String attribute) Gets the value of a string attribute.getAttributeStringv
(Str attribute) Gets the value of a stringv attribute.getAttributeStringv
(String attribute) Gets the value of a stringv attribute.int
getAttributeType
(Str attribute) Gets the attribute type for an attribute key.int
getAttributeType
(String attribute) Gets the attribute type for an attribute key.int
getAttributeUint32
(Str attribute) Gets an unsigned 32-bit integer contained within the attribute.int
getAttributeUint32
(String attribute) Gets an unsigned 32-bit integer contained within the attribute.long
getAttributeUint64
(Str attribute) Gets a unsigned 64-bit integer contained within the attribute.long
getAttributeUint64
(String attribute) Gets a unsigned 64-bit integer contained within the attribute.static ClassHandler
Gets the file's content type.Gets the creation time of the current @info and returns it as a
#GDateTime.Returns the #GDateTime representing the deletion date of the file, as
available in G_FILE_ATTRIBUTE_TRASH_DELETION_DATE.Gets a display name for a file.Gets the edit name for a file.getEtag()
Gets the [entity tag][gfile-etag] for a given
#GFileInfo.int
Gets a file's type (whether it is a regular file, symlink, etc).getIcon()
Gets the icon for a file.static int
boolean
Checks if a file is a backup file.boolean
Checks if a file is hidden.boolean
Checks if a file is a symlink.Gets the modification time of the current @info and returns it as a
#GDateTime.getName()
Gets the name for a file.static long
static TypeSystem.TypeSize
int
Gets the value of the sort_order attribute from the #GFileInfo.Gets the symbolic icon for a file.Gets the symlink target for a given #GFileInfo.static long
static TypeSystem.TypeSize
boolean
hasAttribute
(Str attribute) Checks if a file info structure has an attribute named @attribute.boolean
hasAttribute
(String attribute) Checks if a file info structure has an attribute named @attribute.boolean
hasNamespace
(Str name_space) Checks if a file info structure has an attribute in the
specified @name_space.boolean
hasNamespace
(String name_space) Checks if a file info structure has an attribute in the
specified @name_space.listAttributes
(Str name_space) Lists the file info structure's attributes.listAttributes
(String name_space) Lists the file info structure's attributes.void
removeAttribute
(Str attribute) Removes all cases of @attribute from @info if it exists.void
removeAttribute
(String attribute) Removes all cases of @attribute from @info if it exists.void
setAccessDateTime
(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.void
setAttribute
(Str attribute, int type, Pointer value_p) Sets the @attribute to contain the given value, if possible.void
setAttribute
(String attribute, int type, Pointer value_p) Sets the @attribute to contain the given value, if possible.void
setAttributeBoolean
(Str attribute, boolean attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeBoolean
(String attribute, boolean attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeByteString
(Str attribute, Str attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeByteString
(String attribute, String attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeInt32
(Str attribute, int attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeInt32
(String attribute, int attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeInt64
(Str attribute, long attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeInt64
(String attribute, long attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
Sets @mask on @info to match specific attribute types.void
setAttributeObject
(Str attribute, Object attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeObject
(String attribute, Object attr_value) Sets the @attribute to contain the given @attr_value,
if possible.boolean
setAttributeStatus
(Str attribute, int status) Sets the attribute status for an attribute key.boolean
setAttributeStatus
(String attribute, int status) Sets the attribute status for an attribute key.void
setAttributeString
(Str attribute, Str attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeString
(String attribute, String attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeStringv
(Str attribute, Strs attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeStringv
(String attribute, Strs attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeUint32
(Str attribute, int attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeUint32
(String attribute, int attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeUint64
(Str attribute, long attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setAttributeUint64
(String attribute, long attr_value) Sets the @attribute to contain the given @attr_value,
if possible.void
setContentType
(Str content_type) Sets the content type attribute for a given #GFileInfo.void
setContentType
(String content_type) Sets the content type attribute for a given #GFileInfo.void
setCreationDateTime
(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.void
setDisplayName
(Str display_name) Sets the display name for the current #GFileInfo.void
setDisplayName
(String display_name) Sets the display name for the current #GFileInfo.void
setEditName
(Str edit_name) Sets the edit name for the current file.void
setEditName
(String edit_name) Sets the edit name for the current file.void
setFileType
(int type) Sets the file type in a #GFileInfo to @type.void
Sets the icon for a given #GFileInfo.void
setIsHidden
(boolean is_hidden) Sets the "is_hidden" attribute in a #GFileInfo according to @is_hidden.void
setIsSymlink
(boolean is_symlink) Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.void
setModificationDateTime
(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.void
Sets the name attribute for the current #GFileInfo.void
Sets the name attribute for the current #GFileInfo.void
setSortOrder
(int sort_order) Sets the sort order attribute in the file info structure.void
setSymbolicIcon
(Icon icon) Sets the symbolic icon for a given #GFileInfo.void
setSymlinkTarget
(Str symlink_target) Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
to the given symlink target.void
setSymlinkTarget
(String symlink_target) Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
to the given symlink target.void
Unsets a mask set by g_file_info_set_attribute_mask(), if one
is set.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
FileInfo
-
FileInfo
public FileInfo()Creates a new file info structure.
-
-
Method Details
-
getClassHandler
-
clearStatus
public void clearStatus()Clears the status information from @info. -
copyInto
First clears all of the [GFileAttribute][gio-GFileAttribute] of @dest_info,
and then copies all of the file attributes from @src_info to @dest_info.- Parameters:
dest_info
- destination to copy attributes to.
-
dup
Duplicates a file info structure.- Returns:
- a duplicate #GFileInfo of @other.
-
getAccessDateTime
Gets the access time of the current @info and returns it as a
#GDateTime.
This requires the %G_FILE_ATTRIBUTE_TIME_ACCESS attribute. If
%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC is provided, the resulting #GDateTime
will 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().- Returns:
- access time, or %NULL if unknown
-
getAttributeAsString
Gets the value of a attribute, formatted as a string.
This escapes things as needed to make the string valid
UTF-8.- Parameters:
attribute
- a file attribute key.- Returns:
- 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
Gets the value of a attribute, formatted as a string.
This escapes things as needed to make the string valid
UTF-8.- Parameters:
attribute
- a file attribute key.- Returns:
- 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
Gets the value of a boolean attribute. If the attribute does not
contain a boolean value, %FALSE will be returned.- Parameters:
attribute
- a file attribute key.- Returns:
- the boolean value contained within the attribute.
-
getAttributeBoolean
Gets the value of a boolean attribute. If the attribute does not
contain a boolean value, %FALSE will be returned.- Parameters:
attribute
- a file attribute key.- Returns:
- the boolean value contained within the attribute.
-
getAttributeByteString
Gets the value of a byte string attribute. If the attribute does
not contain a byte string, %NULL will be returned.- Parameters:
attribute
- a file attribute key.- Returns:
- the contents of the @attribute value as a byte string, or %NULL otherwise.
-
getAttributeByteString
Gets the value of a byte string attribute. If the attribute does
not contain a byte string, %NULL will be returned.- Parameters:
attribute
- a file attribute key.- Returns:
- the contents of the @attribute value as a byte string, or %NULL otherwise.
-
getAttributeInt32
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.- Parameters:
attribute
- a file attribute key.- Returns:
- a signed 32-bit integer from the attribute.
-
getAttributeInt32
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.- Parameters:
attribute
- a file attribute key.- Returns:
- a signed 32-bit integer from the attribute.
-
getAttributeInt64
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.- Parameters:
attribute
- a file attribute key.- Returns:
- a signed 64-bit integer from the attribute.
-
getAttributeInt64
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.- Parameters:
attribute
- a file attribute key.- Returns:
- a signed 64-bit integer from the attribute.
-
getAttributeObject
Gets the value of a #GObject attribute. If the attribute does
not contain a #GObject, %NULL will be returned.- Parameters:
attribute
- a file attribute key.- Returns:
- a #GObject associated with the given @attribute, or %NULL otherwise.
-
getAttributeObject
Gets the value of a #GObject attribute. If the attribute does
not contain a #GObject, %NULL will be returned.- Parameters:
attribute
- a file attribute key.- Returns:
- a #GObject associated with the given @attribute, or %NULL otherwise.
-
getAttributeStatus
Gets the attribute status for an attribute key.- Parameters:
attribute
- a file attribute key- Returns:
- a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
-
getAttributeStatus
Gets the attribute status for an attribute key.- Parameters:
attribute
- a file attribute key- Returns:
- a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
-
getAttributeString
Gets the value of a string attribute. If the attribute does
not contain a string, %NULL will be returned.- Parameters:
attribute
- a file attribute key.- Returns:
- the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
-
getAttributeString
Gets the value of a string attribute. If the attribute does
not contain a string, %NULL will be returned.- Parameters:
attribute
- a file attribute key.- Returns:
- the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
-
getAttributeStringv
Gets the value of a stringv attribute. If the attribute does
not contain a stringv, %NULL will be returned.- Parameters:
attribute
- a file attribute key.- Returns:
- the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
-
getAttributeStringv
Gets the value of a stringv attribute. If the attribute does
not contain a stringv, %NULL will be returned.- Parameters:
attribute
- a file attribute key.- Returns:
- the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
-
getAttributeType
Gets the attribute type for an attribute key.- Parameters:
attribute
- a file attribute key.- Returns:
- a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
-
getAttributeType
Gets the attribute type for an attribute key.- Parameters:
attribute
- a file attribute key.- Returns:
- a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
-
getAttributeUint32
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.- Parameters:
attribute
- a file attribute key.- Returns:
- an unsigned 32-bit integer from the attribute.
-
getAttributeUint32
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.- Parameters:
attribute
- a file attribute key.- Returns:
- an unsigned 32-bit integer from the attribute.
-
getAttributeUint64
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.- Parameters:
attribute
- a file attribute key.- Returns:
- a unsigned 64-bit integer from the attribute.
-
getAttributeUint64
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.- Parameters:
attribute
- a file attribute key.- Returns:
- a unsigned 64-bit integer from the attribute.
-
getContentType
Gets the file's content type.- Returns:
- a string containing the file's content type, or %NULL if unknown.
-
getCreationDateTime
Gets the creation time of the current @info and returns it as a
#GDateTime.
This requires the %G_FILE_ATTRIBUTE_TIME_CREATED attribute. If
%G_FILE_ATTRIBUTE_TIME_CREATED_USEC is provided, the resulting #GDateTime
will 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().- Returns:
- creation time, or %NULL if unknown
-
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.- Returns:
- a #GDateTime, or %NULL.
-
getDisplayName
Gets a display name for a file. This is guaranteed to always be set.- Returns:
- a string containing the display name.
-
getEditName
Gets the edit name for a file.- Returns:
- a string containing the edit name.
-
getEtag
Gets the [entity tag][gfile-etag] for a given
#GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.- Returns:
- 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().- Returns:
- a #GFileType for the given file.
-
getIcon
Gets the icon for a file.- Returns:
- #GIcon for the given @info.
-
getIsBackup
public boolean getIsBackup()Checks if a file is a backup file.- Returns:
- %TRUE if file is a backup file, %FALSE otherwise.
-
getIsHidden
public boolean getIsHidden()Checks if a file is hidden.- Returns:
- %TRUE if the file is a hidden file, %FALSE otherwise.
-
getIsSymlink
public boolean getIsSymlink()Checks if a file is a symlink.- Returns:
- %TRUE if the given @info is a symlink.
-
getModificationDateTime
Gets the modification time of the current @info and returns it as a
#GDateTime.
This requires the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute. If
%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC is provided, the resulting #GDateTime
will 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().- Returns:
- modification time, or %NULL if unknown
-
getName
Gets the name for a file. This is guaranteed to always be set.- Returns:
- 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.- Returns:
- a #gint32 containing the value of the "standard::sort_order" attribute.
-
getSymbolicIcon
Gets the symbolic icon for a file.- Returns:
- #GIcon for the given @info.
-
getSymlinkTarget
Gets the symlink target for a given #GFileInfo.- Returns:
- a string containing the symlink target.
-
hasAttribute
Checks if a file info structure has an attribute named @attribute.- Parameters:
attribute
- a file attribute key.- Returns:
- %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
-
hasAttribute
Checks if a file info structure has an attribute named @attribute.- Parameters:
attribute
- a file attribute key.- Returns:
- %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
-
hasNamespace
Checks if a file info structure has an attribute in the
specified @name_space.- Parameters:
name_space
- a file attribute namespace.- Returns:
- %TRUE if @info has an attribute in @name_space, %FALSE otherwise.
-
hasNamespace
Checks if a file info structure has an attribute in the
specified @name_space.- Parameters:
name_space
- a file attribute namespace.- Returns:
- %TRUE if @info has an attribute in @name_space, %FALSE otherwise.
-
listAttributes
Lists the file info structure's attributes.- Parameters:
name_space
- a file attribute key's namespace, or %NULL to list all attributes.- Returns:
- a null-terminated array of strings of all of the possible attribute types for the given @name_space, or %NULL on error.
-
listAttributes
Lists the file info structure's attributes.- Parameters:
name_space
- a file attribute key's namespace, or %NULL to list all attributes.- Returns:
- a null-terminated array of strings of all of the possible attribute types for the given @name_space, or %NULL on error.
-
removeAttribute
Removes all cases of @attribute from @info if it exists.- Parameters:
attribute
- a file attribute key.
-
removeAttribute
Removes all cases of @attribute from @info if it exists.- Parameters:
attribute
- a file attribute key.
-
setAccessDateTime
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.- Parameters:
atime
- a #GDateTime.
-
setAttribute
Sets the @attribute to contain the given value, if possible. To unset the
attribute, use %G_FILE_ATTRIBUTE_TYPE_INVALID for @type.- Parameters:
attribute
- a file attribute key.type
- a #GFileAttributeTypevalue_p
- pointer to the value
-
setAttribute
Sets the @attribute to contain the given value, if possible. To unset the
attribute, use %G_FILE_ATTRIBUTE_TYPE_INVALID for @type.- Parameters:
attribute
- a file attribute key.type
- a #GFileAttributeTypevalue_p
- pointer to the value
-
setAttributeBoolean
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- a boolean value.
-
setAttributeBoolean
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- a boolean value.
-
setAttributeByteString
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- a byte string.
-
setAttributeByteString
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- a byte string.
-
setAttributeInt32
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- a signed 32-bit integer
-
setAttributeInt32
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- a signed 32-bit integer
-
setAttributeInt64
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- attribute name to set.attr_value
- int64 value to set attribute to.
-
setAttributeInt64
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- attribute name to set.attr_value
- int64 value to set attribute to.
-
setAttributeMask
Sets @mask on @info to match specific attribute types.- Parameters:
mask
- a #GFileAttributeMatcher.
-
setAttributeObject
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- a #GObject.
-
setAttributeObject
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- a #GObject.
-
setAttributeStatus
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.- Parameters:
attribute
- a file attribute keystatus
- a #GFileAttributeStatus- Returns:
- %TRUE if the status was changed, %FALSE if the key was not set.
-
setAttributeStatus
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.- Parameters:
attribute
- a file attribute keystatus
- a #GFileAttributeStatus- Returns:
- %TRUE if the status was changed, %FALSE if the key was not set.
-
setAttributeString
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- a UTF-8 string.
-
setAttributeString
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- a UTF-8 string.
-
setAttributeStringv
Sets the @attribute to contain the given @attr_value,
if possible.
Sinze: 2.22- Parameters:
attribute
- a file attribute keyattr_value
- a %NULL terminated array of UTF-8 strings.
-
setAttributeStringv
Sets the @attribute to contain the given @attr_value,
if possible.
Sinze: 2.22- Parameters:
attribute
- a file attribute keyattr_value
- a %NULL terminated array of UTF-8 strings.
-
setAttributeUint32
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- an unsigned 32-bit integer.
-
setAttributeUint32
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- an unsigned 32-bit integer.
-
setAttributeUint64
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- an unsigned 64-bit integer.
-
setAttributeUint64
Sets the @attribute to contain the given @attr_value,
if possible.- Parameters:
attribute
- a file attribute key.attr_value
- an unsigned 64-bit integer.
-
setContentType
Sets the content type attribute for a given #GFileInfo.
See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.- Parameters:
content_type
- a content type. See [GContentType][gio-GContentType]
-
setContentType
Sets the content type attribute for a given #GFileInfo.
See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.- Parameters:
content_type
- a content type. See [GContentType][gio-GContentType]
-
setCreationDateTime
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.- Parameters:
creation_time
- a #GDateTime.
-
setDisplayName
Sets the display name for the current #GFileInfo.
See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.- Parameters:
display_name
- a string containing a display name.
-
setDisplayName
Sets the display name for the current #GFileInfo.
See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.- Parameters:
display_name
- a string containing a display name.
-
setEditName
Sets the edit name for the current file.
See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.- Parameters:
edit_name
- a string containing an edit name.
-
setEditName
Sets the edit name for the current file.
See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.- Parameters:
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.- Parameters:
type
- a #GFileType.
-
setIcon
Sets the icon for a given #GFileInfo.
See %G_FILE_ATTRIBUTE_STANDARD_ICON.- Parameters:
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.- Parameters:
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.- Parameters:
is_symlink
- a #gboolean.
-
setModificationDateTime
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.- Parameters:
mtime
- a #GDateTime.
-
setName
Sets the name attribute for the current #GFileInfo.
See %G_FILE_ATTRIBUTE_STANDARD_NAME.- Parameters:
name
- a string containing a name.
-
setName
Sets the name attribute for the current #GFileInfo.
See %G_FILE_ATTRIBUTE_STANDARD_NAME.- Parameters:
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.- Parameters:
sort_order
- a sort order integer.
-
setSymbolicIcon
Sets the symbolic icon for a given #GFileInfo.
See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.- Parameters:
icon
- a #GIcon.
-
setSymlinkTarget
Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
to the given symlink target.- Parameters:
symlink_target
- a static string containing a path to a symlink target.
-
setSymlinkTarget
Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
to the given symlink target.- Parameters:
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
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-