Class Vfs
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Vfs.Builder<B extends Vfs.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
ConstructorDescriptionVfs
(MemorySegment address) Create a Vfs proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected Vfs
asParent()
Returns this instance as if it were its parent type.static Vfs.Builder
<? extends Vfs.Builder> builder()
AVfs.Builder
object constructs aVfs
with the specified properties.protected Icon
deserializeIcon
(Variant value) static Vfs
Gets the defaultGVfs
for the system.getFileForPath
(String path) Gets aGFile
forpath
.getFileForUri
(String uri) Gets aGFile
foruri
.static Vfs
getLocal()
Gets the localGVfs
for the system.static MemoryLayout
The memory layout of the native struct.String[]
Gets a list of URI schemes supported by this Vfs.static Type
getType()
Get the GType of the Vfs classboolean
isActive()
Checks if the VFS is active.protected void
localFileAddInfo
(String filename, long device, FileAttributeMatcher attributeMatcher, FileInfo info, @Nullable Cancellable cancellable, @Nullable MemorySegment extraData, DestroyNotify freeExtraData) protected void
localFileMoved
(String source, String dest) protected void
localFileRemoved
(String filename) protected boolean
localFileSetAttributes
(String filename, FileInfo info, Set<FileQueryInfoFlags> flags, @Nullable Cancellable cancellable) This operation never fails, but the returned object might not support any I/O operations if theparseName
cannot be parsed by theGVfs
module.boolean
registerUriScheme
(String scheme, @Nullable VfsFileLookupFunc uriFunc, @Nullable VfsFileLookupFunc parseNameFunc) RegistersuriFunc
andparseNameFunc
as theGFile
URI and parse name lookup functions for URIs with a scheme matchingscheme
.boolean
unregisterUriScheme
(String scheme) Unregisters the URI handler forscheme
previously registered with g_vfs_register_uri_scheme().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, 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
-
Vfs
Create a Vfs proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
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. -
getDefault
Gets the defaultGVfs
for the system.- Returns:
- a
GVfs
, which will be the local file systemGVfs
if no other implementation is available.
-
getLocal
-
getFileForPath
-
getFileForUri
Gets aGFile
foruri
.This operation never fails, but the returned object might not support any I/O operation if the URI is malformed or if the URI scheme is not supported.
- Parameters:
uri
- a string containing a URI- Returns:
- a
GFile
. Free the returned object with g_object_unref().
-
getSupportedUriSchemes
Gets a list of URI schemes supported by this Vfs.- Returns:
- a
null
-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
-
isActive
public boolean isActive()Checks if the VFS is active.- Returns:
true
if construction of the this Vfs was successful and it is now active.
-
parseName
This operation never fails, but the returned object might not support any I/O operations if theparseName
cannot be parsed by theGVfs
module.- Parameters:
parseName
- a string to be parsed by the VFS module.- Returns:
- a
GFile
for the givenparseName
. Free the returned object with g_object_unref().
-
registerUriScheme
public boolean registerUriScheme(String scheme, @Nullable @Nullable VfsFileLookupFunc uriFunc, @Nullable @Nullable VfsFileLookupFunc parseNameFunc) RegistersuriFunc
andparseNameFunc
as theGFile
URI and parse name lookup functions for URIs with a scheme matchingscheme
. Note thatscheme
is registered only within the running application, as opposed to desktop-wide as it happens with GVfs backends.When a
GFile
is requested with an URI containingscheme
(e.g. through g_file_new_for_uri()),uriFunc
will be called to allow a custom constructor. The implementation ofuriFunc
should not be blocking, and must not call g_vfs_register_uri_scheme() or g_vfs_unregister_uri_scheme().When g_file_parse_name() is called with a parse name obtained from such file,
parseNameFunc
will be called to allow theGFile
to be created again. In that case, it's responsibility ofparseNameFunc
to make sure the parse name matches what the customGFile
implementation returned when g_file_get_parse_name() was previously called. The implementation ofparseNameFunc
should not be blocking, and must not call g_vfs_register_uri_scheme() or g_vfs_unregister_uri_scheme().It's an error to call this function twice with the same scheme. To unregister a custom URI scheme, use g_vfs_unregister_uri_scheme().
- Parameters:
scheme
- an URI scheme, e.g. "http"uriFunc
- aGVfsFileLookupFunc
parseNameFunc
- aGVfsFileLookupFunc
- Returns:
true
ifscheme
was successfully registered, orfalse
if a handler forscheme
already exists.
-
unregisterUriScheme
Unregisters the URI handler forscheme
previously registered with g_vfs_register_uri_scheme().- Parameters:
scheme
- an URI scheme, e.g. "http"- Returns:
true
ifscheme
was successfully unregistered, orfalse
if a handler forscheme
does not exist.
-
addWritableNamespaces
-
deserializeIcon
-
localFileAddInfo
protected void localFileAddInfo(String filename, long device, FileAttributeMatcher attributeMatcher, FileInfo info, @Nullable @Nullable Cancellable cancellable, @Nullable @Nullable MemorySegment extraData, DestroyNotify freeExtraData) -
localFileMoved
-
localFileRemoved
-
localFileSetAttributes
protected boolean localFileSetAttributes(String filename, FileInfo info, Set<FileQueryInfoFlags> flags, @Nullable @Nullable Cancellable cancellable) throws GErrorException - Throws:
GErrorException
-
builder
AVfs.Builder
object constructs aVfs
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withVfs.Builder.build()
.
-