Class UnixMountEntry
- All Implemented Interfaces:
Proxy
/media/cdrom
).
This corresponds roughly to a mtab entry.-
Field Summary
Fields inherited from class io.github.jwharm.javagi.base.ProxyInstance
address
-
Constructor Summary
ConstructorsConstructorDescriptionUnixMountEntry
(MemorySegment address) Create a UnixMountEntry proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic UnixMountEntry
Gets aGioUnix.MountEntry
for a given mount path.int
compare
(UnixMountEntry mount2) Compares two Unix mounts.copy()
Makes a copy of this UnixMountEntry.static UnixMountEntry
Gets aGioUnix.MountEntry
for a given file path.void
free()
Frees a Unix mount.Gets the device path for a Unix mount.Gets the filesystem type for the Unix mount.Gets the mount path for a Unix mount.Gets a comma separated list of mount options for the Unix mount.Gets the root of the mount within the filesystem.static Type
getType()
Get the GType of the UnixMountEntry classboolean
Guesses whether a Unix mount entry can be ejected.Guesses the icon of a Unix mount entry.Guesses the name of a Unix mount entry.boolean
Guesses whether a Unix mount entry should be displayed in the UI.Guesses the symbolic icon of a Unix mount entry.boolean
Checks if a Unix mount is mounted read only.boolean
Checks if a Unix mount is a system mount.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
UnixMountEntry
Create a UnixMountEntry proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
at
public static UnixMountEntry at(String mountPath, @Nullable @Nullable Out<Long> timeRead) throws UnsupportedPlatformException Gets aGioUnix.MountEntry
for a given mount path.If
timeRead
is set, it will be filled with a Unix timestamp for checking if the mounts have changed since withGioUnix#mountEntriesChangedSince
.If more mounts have the same mount path, the last matching mount is returned.
This will return
NULL
if there is no mount point atmountPath
.- Parameters:
mountPath
- path for a possible Unix mounttimeRead
- return location for a timestamp- Returns:
- a
GioUnix.MountEntry
- Throws:
UnsupportedPlatformException
- when run on a platform other than linux or macos- Since:
- 2.84
-
for_
public static UnixMountEntry for_(String filePath, @Nullable @Nullable Out<Long> timeRead) throws UnsupportedPlatformException Gets aGioUnix.MountEntry
for a given file path.If
timeRead
is set, it will be filled with a Unix timestamp for checking if the mounts have changed since withGioUnix#mountEntriesChangedSince
.If more mounts have the same mount path, the last matching mount is returned.
This will return
NULL
if looking up the mount entry fails, iffilePath
doesn’t exist or there is an I/O error.- Parameters:
filePath
- file path on some Unix mounttimeRead
- return location for a timestamp- Returns:
- a
GioUnix.MountEntry
- Throws:
UnsupportedPlatformException
- when run on a platform other than linux or macos- Since:
- 2.84
-
compare
Compares two Unix mounts.- Parameters:
mount2
- secondGioUnix.MountEntry
to compare- Returns:
1
,0
or-1
if this UnixMountEntry is greater than, equal to, or less thanmount2
, respectively- Since:
- 2.84
-
copy
Makes a copy of this UnixMountEntry.- Returns:
- a new
GioUnix.MountEntry
- Since:
- 2.84
-
free
public void free()Frees a Unix mount.- Since:
- 2.84
-
getDevicePath
Gets the device path for a Unix mount.- Returns:
- a string containing the device path
- Since:
- 2.84
-
getFsType
Gets the filesystem type for the Unix mount.- Returns:
- a string containing the file system type
- Since:
- 2.84
-
getMountPath
Gets the mount path for a Unix mount.- Returns:
- the mount path for this UnixMountEntry
- Since:
- 2.84
-
getOptions
Gets a comma separated list of mount options for the Unix mount.For example:
rw,relatime,seclabel,data=ordered
.This is similar to
MountPoint#getOptions
, but it takes aGioUnix.MountEntry
as an argument.- Returns:
- a string containing the options, or
NULL
if not available. - Since:
- 2.84
-
getRootPath
Gets the root of the mount within the filesystem. This is useful e.g. for mounts created by bind operation, or btrfs subvolumes.For example, the root path is equal to
/
for a mount created bymount /dev/sda1 /mnt/foo
and/bar
formount --bind /mnt/foo/bar /mnt/bar
.- Returns:
- a string containing the root, or
NULL
if not supported - Since:
- 2.84
-
guessCanEject
public boolean guessCanEject()Guesses whether a Unix mount entry can be ejected.- Returns:
- true if this UnixMountEntry is deemed to be ejectable; false otherwise
- Since:
- 2.84
-
guessIcon
-
guessName
Guesses the name of a Unix mount entry.The result is a translated string.
- Returns:
- a newly allocated translated string
- Since:
- 2.84
-
guessShouldDisplay
public boolean guessShouldDisplay()Guesses whether a Unix mount entry should be displayed in the UI.- Returns:
- true if this UnixMountEntry is deemed to be displayable; false otherwise
- Since:
- 2.84
-
guessSymbolicIcon
-
isReadonly
public boolean isReadonly()Checks if a Unix mount is mounted read only.- Returns:
- true if this UnixMountEntry is read only; false otherwise
- Since:
- 2.84
-
isSystemInternal
public boolean isSystemInternal()Checks if a Unix mount is a system mount.This is the Boolean OR of
GioUnix#isSystemFsType
,GioUnix#isSystemDevicePath
andGioUnix#isMountPathSystemInternal
on this UnixMountEntry’s properties.The definition of what a ‘system’ mount entry is may change over time as new file system types and device paths are ignored.
- Returns:
- true if the Unix mount is for a system path; false otherwise
- Since:
- 2.84
-