Class Vfs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classVfs.Builder<B extends Vfs.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionVfs()Creates a new Vfs.Vfs(MemorySegment address) Create a Vfs proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected VfsasParent()Returns this instance as if it were its parent type.static Vfs.Builder<? extends Vfs.Builder> builder()AVfs.Builderobject constructs aVfswith the specified properties.protected IcondeserializeIcon(Variant value) static VfsGets the defaultGVfsfor the system.getFileForPath(String path) Gets aGFileforpath.getFileForUri(String uri) Gets aGFileforuri.static VfsgetLocal()Gets the localGVfsfor the system.static MemoryLayoutThe memory layout of the native struct.String[]Gets a list of URI schemes supported byvfs.static @Nullable TypegetType()Get the GType of the Vfs classbooleanisActive()Checks if the VFS is active.protected voidlocalFileAddInfo(String filename, long device, FileAttributeMatcher attributeMatcher, FileInfo info, @Nullable Cancellable cancellable, @Nullable MemorySegment extraData) protected voidlocalFileMoved(String source, String dest) protected voidlocalFileRemoved(String filename) protected booleanlocalFileSetAttributes(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 theparseNamecannot be parsed by theGVfsmodule.booleanregisterUriScheme(String scheme, @Nullable VfsFileLookupFunc uriFunc, @Nullable VfsFileLookupFunc parseNameFunc) RegistersuriFuncandparseNameFuncas theGFileURI and parse name lookup functions for URIs with a scheme matchingscheme.Note thatschemeis registered only within the running application, as opposed to desktop-wide as it happens with GVfs backends.booleanunregisterUriScheme(String scheme) Unregisters the URI handler forschemepreviously 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, 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, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.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
-
Vfs
public Vfs()Creates a new Vfs.
-
-
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 Javasuperkeyword, 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 defaultGVfsfor the system.- Returns:
- a
GVfs, which will be the local file systemGVfsif no other implementation is available.
-
getLocal
-
getFileForPath
-
getFileForUri
Gets aGFileforuri.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 byvfs.- 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:
trueif 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 theparseNamecannot be parsed by theGVfsmodule.- Parameters:
parseName- a string to be parsed by the VFS module.- Returns:
- a
GFilefor the givenparseName.Free the returned object with g_object_unref().
-
registerUriScheme
public boolean registerUriScheme(String scheme, @Nullable VfsFileLookupFunc uriFunc, @Nullable VfsFileLookupFunc parseNameFunc) RegistersuriFuncandparseNameFuncas theGFileURI and parse name lookup functions for URIs with a scheme matchingscheme.Note thatschemeis registered only within the running application, as opposed to desktop-wide as it happens with GVfs backends.When a
GFileis requested with an URI containingscheme(e.g. through g_file_new_for_uri()),uriFuncwill be called to allow a custom constructor. The implementation ofuriFuncshould 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,
parseNameFuncwill be called to allow theGFileto be created again. In that case, it's responsibility ofparseNameFuncto make sure the parse name matches what the customGFileimplementation returned when g_file_get_parse_name() was previously called. The implementation ofparseNameFuncshould 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- aGVfsFileLookupFuncparseNameFunc- aGVfsFileLookupFunc- Returns:
trueifschemewas successfully registered, orfalseif a handler forschemealready exists.- Since:
- 2.50
-
unregisterUriScheme
Unregisters the URI handler forschemepreviously registered with g_vfs_register_uri_scheme().- Parameters:
scheme- an URI scheme, e.g. "http"- Returns:
trueifschemewas successfully unregistered, orfalseif a handler forschemedoes not exist.- Since:
- 2.50
-
addWritableNamespaces
-
deserializeIcon
-
localFileAddInfo
protected void localFileAddInfo(String filename, long device, FileAttributeMatcher attributeMatcher, FileInfo info, @Nullable Cancellable cancellable, @Nullable MemorySegment extraData) -
localFileMoved
-
localFileRemoved
-
localFileSetAttributes
protected boolean localFileSetAttributes(String filename, FileInfo info, Set<FileQueryInfoFlags> flags, @Nullable Cancellable cancellable) throws GErrorException - Throws:
GErrorException
-
builder
AVfs.Builderobject constructs aVfswith the specified properties. Use the variousset...()methods to set properties, and finish construction withVfs.Builder.build().- Returns:
- the builder object
-