Class FileInfo
- All Implemented Interfaces:
Proxy
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 document for more information on how GIO handles file attributes.
To obtain a GFileInfo
for a File
, use
File.queryInfo(java.lang.String, java.util.Set<org.gnome.gio.FileQueryInfoFlags>, org.gnome.gio.Cancellable)
(or its async variant). To obtain a GFileInfo
for a file input or output stream, use FileInputStream.queryInfo(java.lang.String, org.gnome.gio.Cancellable)
or FileOutputStream.queryInfo(java.lang.String, org.gnome.gio.Cancellable)
(or their async variants).
To change the actual attributes of a file, you should then set the
attribute in the GFileInfo
and call File.setAttributesFromInfo(org.gnome.gio.FileInfo, java.util.Set<org.gnome.gio.FileQueryInfoFlags>, org.gnome.gio.Cancellable)
or File.setAttributesAsync(org.gnome.gio.FileInfo, java.util.Set<org.gnome.gio.FileQueryInfoFlags>, int, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
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 setSize(long)
.
You may call File.querySettableAttributes(org.gnome.gio.Cancellable)
and
File.queryWritableNamespaces(org.gnome.gio.Cancellable)
to discover the settable attributes
of a particular file at runtime.
The direct accessors, such as getName()
, are slightly more
optimized than the generic attribute accessors, such as
getAttributeByteString(java.lang.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
hasAttribute(java.lang.String)
or listAttributes(java.lang.String)
to check what attributes are specified for a GFileInfo
.
Gio.FileAttributeMatcher
allows for searching through a GFileInfo
for attributes.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
FileInfo.Builder<B extends FileInfo.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionFileInfo()
Creates a new file info structure.FileInfo
(MemorySegment address) Create a FileInfo proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected FileInfo
asParent()
Returns this instance as if it were its parent type.static FileInfo.Builder
<? extends FileInfo.Builder> builder()
AFileInfo.Builder
object constructs aFileInfo
with the specified properties.void
Clears the status information from this FileInfo.void
First clears all of the [GFileAttribute][gio-GFileAttribute] ofdestInfo
, and then copies all of the file attributes from this FileInfo todestInfo
.dup()
Duplicates a file info structure.Gets the access time of the current this FileInfo and returns it as aGDateTime
.getAttributeAsString
(String attribute) Gets the value of an attribute, formatted as a string.boolean
getAttributeBoolean
(String attribute) Gets the value of a boolean attribute.getAttributeByteString
(String attribute) Gets the value of a byte string attribute.boolean
getAttributeData
(String attribute, @Nullable Out<FileAttributeType> type, @Nullable Out<MemorySegment> valuePp, @Nullable Out<FileAttributeStatus> status) Gets the attribute type, value and status for an attribute key.getAttributeFilePath
(String attribute) Gets the value of a byte string attribute as a file path.int
getAttributeInt32
(String attribute) Gets a signed 32-bit integer contained within the attribute.long
getAttributeInt64
(String attribute) Gets a signed 64-bit integer contained within the attribute.getAttributeObject
(String attribute) Gets the value of aGObject
attribute.getAttributeStatus
(String attribute) Gets the attribute status for an attribute key.getAttributeString
(String attribute) Gets the value of a string attribute.String[]
getAttributeStringv
(String attribute) Gets the value of a stringv attribute.getAttributeType
(String attribute) Gets the attribute type for an attribute key.int
getAttributeUint32
(String attribute) Gets an unsigned 32-bit integer contained within the attribute.long
getAttributeUint64
(String attribute) Gets a unsigned 64-bit integer contained within the attribute.Gets the file's content type.Gets the creation time of the current this FileInfo and returns it as aGDateTime
.Returns theGDateTime
representing the deletion date of the file, as available inG_FILE_ATTRIBUTE_TRASH_DELETION_DATE
.Gets a display name for a file.Gets the edit name for a file.getEtag()
Gets the entity tag for a givenGFileInfo
.Gets a file's type (whether it is a regular file, symlink, etc).getIcon()
Gets the icon for a file.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 this FileInfo and returns it as aGDateTime
.void
getModificationTime
(TimeVal result) Deprecated.getName()
Gets the name for a file.long
getSize()
Gets the file's size (in bytes).int
Gets the value of the sort_order attribute from theGFileInfo
.Gets the symbolic icon for a file.Gets the symlink target for a givenGFileInfo
.static Type
getType()
Get the GType of the FileInfo classboolean
hasAttribute
(String attribute) Checks if a file info structure has an attribute namedattribute
.boolean
hasNamespace
(String nameSpace) Checks if a file info structure has an attribute in the specifiednameSpace
.String[]
listAttributes
(@Nullable String nameSpace) Lists the file info structure's attributes.void
removeAttribute
(String attribute) Removes all cases ofattribute
from this FileInfo if it exists.void
setAccessDateTime
(DateTime atime) Sets theG_FILE_ATTRIBUTE_TIME_ACCESS
andG_FILE_ATTRIBUTE_TIME_ACCESS_USEC
attributes in the file info to the given date/time value.void
setAttribute
(String attribute, FileAttributeType type, MemorySegment valueP) Sets theattribute
to contain the given value, if possible.void
setAttributeBoolean
(String attribute, boolean attrValue) Sets theattribute
to contain the givenattrValue
, if possible.void
setAttributeByteString
(String attribute, String attrValue) Sets theattribute
to contain the givenattrValue
, if possible.void
setAttributeFilePath
(String attribute, String attrValue) Sets theattribute
to contain the givenattrValue
, if possible.void
setAttributeInt32
(String attribute, int attrValue) Sets theattribute
to contain the givenattrValue
, if possible.void
setAttributeInt64
(String attribute, long attrValue) Sets theattribute
to contain the givenattrValue
, if possible.void
Setsmask
on this FileInfo to match specific attribute types.void
setAttributeObject
(String attribute, GObject attrValue) Sets theattribute
to contain the givenattrValue
, if possible.boolean
setAttributeStatus
(String attribute, FileAttributeStatus status) Sets the attribute status for an attribute key.void
setAttributeString
(String attribute, String attrValue) Sets theattribute
to contain the givenattrValue
, if possible.void
setAttributeStringv
(String attribute, String[] attrValue) Sets theattribute
to contain the givenattrValue
, if possible.void
setAttributeUint32
(String attribute, int attrValue) Sets theattribute
to contain the givenattrValue
, if possible.void
setAttributeUint64
(String attribute, long attrValue) Sets theattribute
to contain the givenattrValue
, if possible.void
setContentType
(String contentType) Sets the content type attribute for a givenGFileInfo
.void
setCreationDateTime
(DateTime creationTime) Sets theG_FILE_ATTRIBUTE_TIME_CREATED
andG_FILE_ATTRIBUTE_TIME_CREATED_USEC
attributes in the file info to the given date/time value.void
setDisplayName
(String displayName) Sets the display name for the currentGFileInfo
.void
setEditName
(String editName) Sets the edit name for the current file.void
setFileType
(FileType type) Sets the file type in aGFileInfo
totype
.void
Sets the icon for a givenGFileInfo
.void
setIsHidden
(boolean isHidden) Sets the "is_hidden" attribute in aGFileInfo
according toisHidden
.void
setIsSymlink
(boolean isSymlink) Sets the "is_symlink" attribute in aGFileInfo
according toisSymlink
.void
setModificationDateTime
(DateTime mtime) Sets theG_FILE_ATTRIBUTE_TIME_MODIFIED
andG_FILE_ATTRIBUTE_TIME_MODIFIED_USEC
attributes in the file info to the given date/time value.void
setModificationTime
(TimeVal mtime) Deprecated.Use g_file_info_set_modification_date_time() instead, asGTimeVal
is deprecated due to the year 2038 problem.void
Sets the name attribute for the currentGFileInfo
.void
setSize
(long size) Sets theG_FILE_ATTRIBUTE_STANDARD_SIZE
attribute in the file info to the given size.void
setSortOrder
(int sortOrder) Sets the sort order attribute in the file info structure.void
setSymbolicIcon
(Icon icon) Sets the symbolic icon for a givenGFileInfo
.void
setSymlinkTarget
(String symlinkTarget) Sets theG_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 org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
clearStatus
public void clearStatus()Clears the status information from this FileInfo. -
copyInto
First clears all of the [GFileAttribute][gio-GFileAttribute] ofdestInfo
, and then copies all of the file attributes from this FileInfo todestInfo
.- Parameters:
destInfo
- destination to copy attributes to.
-
dup
Duplicates a file info structure.- Returns:
- a duplicate
GFileInfo
of this FileInfo.
-
getAccessDateTime
Gets the access time of the current this FileInfo and returns it as aGDateTime
.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_TIME_ACCESS
. IfG_FILE_ATTRIBUTE_TIME_ACCESS_USEC
is provided, the resultingGDateTime
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().- Returns:
- access time, or
null
if unknown
-
getAttributeAsString
Gets the value of an 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
, ornull
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.
-
getAttributeByteString
-
getAttributeData
public boolean getAttributeData(String attribute, @Nullable @Nullable Out<FileAttributeType> type, @Nullable @Nullable Out<MemorySegment> valuePp, @Nullable @Nullable Out<FileAttributeStatus> status) Gets the attribute type, value and status for an attribute key.- Parameters:
attribute
- a file attribute keytype
- return location for the attribute type, ornull
valuePp
- return location for the attribute value, ornull
; the attribute value will not benull
status
- return location for the attribute status, ornull
- Returns:
true
if this FileInfo has an attribute namedattribute
,false
otherwise.
-
getAttributeFilePath
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.
- Parameters:
attribute
- a file attribute key.- Returns:
- the contents of the
attribute
value as a file path, ornull
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.
-
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
-
getAttributeStatus
Gets the attribute status for an attribute key.- Parameters:
attribute
- a file attribute key- Returns:
- a
GFileAttributeStatus
for the givenattribute
, orFileAttributeStatus.UNSET
if the key is invalid.
-
getAttributeString
-
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, ornull
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 givenattribute
, orFileAttributeType.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.
-
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.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE
.- Returns:
- a string containing the file's content type,
or
null
if unknown.
-
getCreationDateTime
Gets the creation time of the current this FileInfo and returns it as aGDateTime
.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_TIME_CREATED
. IfG_FILE_ATTRIBUTE_TIME_CREATED_USEC
is provided, the resultingGDateTime
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().- Returns:
- creation time, or
null
if unknown
-
getDeletionDate
Returns theGDateTime
representing the deletion date of the file, as available inG_FILE_ATTRIBUTE_TRASH_DELETION_DATE
. If theG_FILE_ATTRIBUTE_TRASH_DELETION_DATE
attribute is unset,null
is returned.- Returns:
- a
GDateTime
, ornull
.
-
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 containG_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
.- Returns:
- a string containing the display name.
-
getEditName
Gets the edit name for a file.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_STANDARD_EDIT_NAME
.- Returns:
- a string containing the edit name.
-
getEtag
Gets the entity tag for a givenGFileInfo
. SeeG_FILE_ATTRIBUTE_ETAG_VALUE
.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_ETAG_VALUE
.- Returns:
- a string containing the value of the "etag:value" attribute.
-
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 containG_FILE_ATTRIBUTE_STANDARD_TYPE
.- Returns:
- a
GFileType
for the given file.
-
getIcon
Gets the icon for a file.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_STANDARD_ICON
.- Returns:
GIcon
for the given this FileInfo.
-
getIsBackup
public boolean getIsBackup()Checks if a file is a backup file.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_STANDARD_IS_BACKUP
.- Returns:
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 containG_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN
.- Returns:
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 containG_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK
.- Returns:
true
if the given this FileInfo is a symlink.
-
getModificationDateTime
Gets the modification time of the current this FileInfo and returns it as aGDateTime
.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_TIME_MODIFIED
. IfG_FILE_ATTRIBUTE_TIME_MODIFIED_USEC
is provided, the resultingGDateTime
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().- Returns:
- modification time, or
null
if unknown
-
getModificationTime
Deprecated.Use g_file_info_get_modification_date_time() instead, asGTimeVal
is deprecated due to the year 2038 problem.Gets the modification time of the current this FileInfo and sets it inresult
.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_TIME_MODIFIED
. IfG_FILE_ATTRIBUTE_TIME_MODIFIED_USEC
is provided it will be used too.- Parameters:
result
- aGTimeVal
.
-
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 containG_FILE_ATTRIBUTE_STANDARD_NAME
.- Returns:
- a string containing the file name.
-
getSize
public long getSize()Gets the file's size (in bytes). The size is retrieved through the value of theG_FILE_ATTRIBUTE_STANDARD_SIZE
attribute and is converted fromguint64
togoffset
before returning the result.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_STANDARD_SIZE
.- Returns:
- a
goffset
containing the file's size (in bytes).
-
getSortOrder
public int getSortOrder()Gets the value of the sort_order attribute from theGFileInfo
. SeeG_FILE_ATTRIBUTE_STANDARD_SORT_ORDER
.It is an error to call this if the
GFileInfo
does not containG_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.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON
.- Returns:
GIcon
for the given this FileInfo.
-
getSymlinkTarget
Gets the symlink target for a givenGFileInfo
.It is an error to call this if the
GFileInfo
does not containG_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET
.- Returns:
- a string containing the symlink target.
-
hasAttribute
Checks if a file info structure has an attribute namedattribute
.- Parameters:
attribute
- a file attribute key.- Returns:
true
if this FileInfo has an attribute namedattribute
,false
otherwise.
-
hasNamespace
Checks if a file info structure has an attribute in the specifiednameSpace
.- Parameters:
nameSpace
- a file attribute namespace.- Returns:
true
if this FileInfo has an attribute innameSpace
,false
otherwise.
-
listAttributes
Lists the file info structure's attributes.- Parameters:
nameSpace
- a file attribute key's namespace, ornull
to list all attributes.- Returns:
- a
null-terminated array of strings of all of the possible attribute
types for the given
nameSpace
, ornull
on error.
-
removeAttribute
Removes all cases ofattribute
from this FileInfo if it exists.- Parameters:
attribute
- a file attribute key.
-
setAccessDateTime
Sets theG_FILE_ATTRIBUTE_TIME_ACCESS
andG_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
- aGDateTime
.
-
setAttribute
Sets theattribute
to contain the given value, if possible. To unset the attribute, useFileAttributeType.INVALID
fortype
.- Parameters:
attribute
- a file attribute key.type
- aGFileAttributeType
valueP
- pointer to the value
-
setAttributeBoolean
Sets theattribute
to contain the givenattrValue
, if possible.- Parameters:
attribute
- a file attribute key.attrValue
- a boolean value.
-
setAttributeByteString
-
setAttributeFilePath
Sets theattribute
to contain the givenattrValue
, if possible.This function is meant to be used by language bindings that have specific handling for Unix paths.
- Parameters:
attribute
- a file attribute key.attrValue
- a file path.
-
setAttributeInt32
Sets theattribute
to contain the givenattrValue
, if possible.- Parameters:
attribute
- a file attribute key.attrValue
- a signed 32-bit integer
-
setAttributeInt64
Sets theattribute
to contain the givenattrValue
, if possible.- Parameters:
attribute
- attribute name to set.attrValue
- int64 value to set attribute to.
-
setAttributeMask
Setsmask
on this FileInfo to match specific attribute types.- Parameters:
mask
- aGFileAttributeMatcher
.
-
setAttributeObject
-
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 this FileInfo for this to work. Otherwise
false
is returned and this FileInfo is unchanged.- Parameters:
attribute
- a file attribute keystatus
- aGFileAttributeStatus
- Returns:
true
if the status was changed,false
if the key was not set.
-
setAttributeString
-
setAttributeStringv
-
setAttributeUint32
Sets theattribute
to contain the givenattrValue
, if possible.- Parameters:
attribute
- a file attribute key.attrValue
- an unsigned 32-bit integer.
-
setAttributeUint64
Sets theattribute
to contain the givenattrValue
, if possible.- Parameters:
attribute
- a file attribute key.attrValue
- an unsigned 64-bit integer.
-
setContentType
Sets the content type attribute for a givenGFileInfo
. SeeG_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE
.- Parameters:
contentType
- a content type. See [GContentType][gio-GContentType]
-
setCreationDateTime
Sets theG_FILE_ATTRIBUTE_TIME_CREATED
andG_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:
creationTime
- aGDateTime
.
-
setDisplayName
Sets the display name for the currentGFileInfo
. SeeG_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
.- Parameters:
displayName
- a string containing a display name.
-
setEditName
Sets the edit name for the current file. SeeG_FILE_ATTRIBUTE_STANDARD_EDIT_NAME
.- Parameters:
editName
- a string containing an edit name.
-
setFileType
Sets the file type in aGFileInfo
totype
. SeeG_FILE_ATTRIBUTE_STANDARD_TYPE
.- Parameters:
type
- aGFileType
.
-
setIcon
Sets the icon for a givenGFileInfo
. SeeG_FILE_ATTRIBUTE_STANDARD_ICON
.- Parameters:
icon
- aGIcon
.
-
setIsHidden
public void setIsHidden(boolean isHidden) Sets the "is_hidden" attribute in aGFileInfo
according toisHidden
. SeeG_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN
.- Parameters:
isHidden
- agboolean
.
-
setIsSymlink
public void setIsSymlink(boolean isSymlink) Sets the "is_symlink" attribute in aGFileInfo
according toisSymlink
. SeeG_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK
.- Parameters:
isSymlink
- agboolean
.
-
setModificationDateTime
Sets theG_FILE_ATTRIBUTE_TIME_MODIFIED
andG_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
- aGDateTime
.
-
setModificationTime
Deprecated.Use g_file_info_set_modification_date_time() instead, asGTimeVal
is deprecated due to the year 2038 problem.Sets theG_FILE_ATTRIBUTE_TIME_MODIFIED
andG_FILE_ATTRIBUTE_TIME_MODIFIED_USEC
attributes in the file info to the given time value.G_FILE_ATTRIBUTE_TIME_MODIFIED_NSEC
will be cleared.- Parameters:
mtime
- aGTimeVal
.
-
setName
Sets the name attribute for the currentGFileInfo
. SeeG_FILE_ATTRIBUTE_STANDARD_NAME
.- Parameters:
name
- a string containing a name.
-
setSize
public void setSize(long size) Sets theG_FILE_ATTRIBUTE_STANDARD_SIZE
attribute in the file info to the given size.- Parameters:
size
- agoffset
containing the file's size.
-
setSortOrder
public void setSortOrder(int sortOrder) Sets the sort order attribute in the file info structure. SeeG_FILE_ATTRIBUTE_STANDARD_SORT_ORDER
.- Parameters:
sortOrder
- a sort order integer.
-
setSymbolicIcon
Sets the symbolic icon for a givenGFileInfo
. SeeG_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON
.- Parameters:
icon
- aGIcon
.
-
setSymlinkTarget
Sets theG_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET
attribute in the file info to the given symlink target.- Parameters:
symlinkTarget
- 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. -
builder
AFileInfo.Builder
object constructs aFileInfo
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withFileInfo.Builder.build()
.
-
GTimeVal
is deprecated due to the year 2038 problem.