Package ch.bailu.gtk.gio
Class Vfs
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gio.Vfs
- All Implemented Interfaces:
PointerInterface
Entry point for using GIO functionality.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassHandler
static Vfs
Gets the default #GVfs for the system.getFileForPath
(Str path) Gets a #GFile for @path.getFileForPath
(String path) Gets a #GFile for @path.getFileForUri
(Str uri) Gets a #GFile for @uri.getFileForUri
(String uri) Gets a #GFile for @uri.static int
static Vfs
getLocal()
Gets the local #GVfs for the system.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
boolean
isActive()
Checks if the VFS is active.This operation never fails, but the returned object might
not support any I/O operations if the @parse_name cannot
be parsed by the #GVfs module.This operation never fails, but the returned object might
not support any I/O operations if the @parse_name cannot
be parsed by the #GVfs module.boolean
registerUriScheme
(Str scheme, Vfs.OnVfsFileLookupFunc uri_func, Pointer uri_data, Vfs.OnDestroyNotify uri_destroy, Vfs.OnVfsFileLookupFunc parse_name_func, Pointer parse_name_data, Vfs.OnDestroyNotify parse_name_destroy) Registers @uri_func and @parse_name_func as the #GFile URI and parse name
lookup functions for URIs with a scheme matching @scheme.boolean
registerUriScheme
(String scheme, Vfs.OnVfsFileLookupFunc uri_func, Pointer uri_data, Vfs.OnDestroyNotify uri_destroy, Vfs.OnVfsFileLookupFunc parse_name_func, Pointer parse_name_data, Vfs.OnDestroyNotify parse_name_destroy) Registers @uri_func and @parse_name_func as the #GFile URI and parse name
lookup functions for URIs with a scheme matching @scheme.boolean
unregisterUriScheme
(Str scheme) Unregisters the URI handler for @scheme previously registered with
g_vfs_register_uri_scheme().boolean
unregisterUriScheme
(String scheme) Unregisters the URI handler for @scheme previously registered with
g_vfs_register_uri_scheme().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
-
Vfs
-
-
Method Details
-
getClassHandler
-
getFileForPath
Gets a #GFile for @path.- Parameters:
path
- a string containing a VFS path.- Returns:
- a #GFile. Free the returned object with g_object_unref().
-
getFileForPath
Gets a #GFile for @path.- Parameters:
path
- a string containing a VFS path.- Returns:
- a #GFile. Free the returned object with g_object_unref().
-
getFileForUri
Gets a #GFile for @uri.
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().
-
getFileForUri
Gets a #GFile for @uri.
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().
-
isActive
public boolean isActive()Checks if the VFS is active.- Returns:
- %TRUE if construction of the @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 the @parse_name cannot
be parsed by the #GVfs module.- Parameters:
parse_name
- a string to be parsed by the VFS module.- Returns:
- a #GFile for the given @parse_name. Free the returned object with g_object_unref().
-
parseName
This operation never fails, but the returned object might
not support any I/O operations if the @parse_name cannot
be parsed by the #GVfs module.- Parameters:
parse_name
- a string to be parsed by the VFS module.- Returns:
- a #GFile for the given @parse_name. Free the returned object with g_object_unref().
-
registerUriScheme
public boolean registerUriScheme(@Nonnull Str scheme, Vfs.OnVfsFileLookupFunc uri_func, @Nullable Pointer uri_data, Vfs.OnDestroyNotify uri_destroy, Vfs.OnVfsFileLookupFunc parse_name_func, @Nullable Pointer parse_name_data, Vfs.OnDestroyNotify parse_name_destroy) Registers @uri_func and @parse_name_func as the #GFile URI and parse name
lookup functions for URIs with a scheme matching @scheme.
Note that @scheme 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 containing @scheme (e.g. through
g_file_new_for_uri()), @uri_func will be called to allow a custom
constructor. The implementation of @uri_func 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,
@parse_name_func will be called to allow the #GFile to be created again. In
that case, it's responsibility of @parse_name_func to make sure the parse
name matches what the custom #GFile implementation returned when
g_file_get_parse_name() was previously called. The implementation of
@parse_name_func 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"uri_func
- a #GVfsFileLookupFuncuri_data
- custom data passed to be passed to @uri_func, or %NULLuri_destroy
- function to be called when unregistering the URI scheme, or when @vfs is disposed, to free the resources used by the URI lookup functionparse_name_func
- a #GVfsFileLookupFuncparse_name_data
- custom data passed to be passed to @parse_name_func, or %NULLparse_name_destroy
- function to be called when unregistering the URI scheme, or when @vfs is disposed, to free the resources used by the parse name lookup function- Returns:
- %TRUE if @scheme was successfully registered, or %FALSE if a handler for @scheme already exists.
-
registerUriScheme
public boolean registerUriScheme(String scheme, Vfs.OnVfsFileLookupFunc uri_func, @Nullable Pointer uri_data, Vfs.OnDestroyNotify uri_destroy, Vfs.OnVfsFileLookupFunc parse_name_func, @Nullable Pointer parse_name_data, Vfs.OnDestroyNotify parse_name_destroy) Registers @uri_func and @parse_name_func as the #GFile URI and parse name
lookup functions for URIs with a scheme matching @scheme.
Note that @scheme 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 containing @scheme (e.g. through
g_file_new_for_uri()), @uri_func will be called to allow a custom
constructor. The implementation of @uri_func 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,
@parse_name_func will be called to allow the #GFile to be created again. In
that case, it's responsibility of @parse_name_func to make sure the parse
name matches what the custom #GFile implementation returned when
g_file_get_parse_name() was previously called. The implementation of
@parse_name_func 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"uri_func
- a #GVfsFileLookupFuncuri_data
- custom data passed to be passed to @uri_func, or %NULLuri_destroy
- function to be called when unregistering the URI scheme, or when @vfs is disposed, to free the resources used by the URI lookup functionparse_name_func
- a #GVfsFileLookupFuncparse_name_data
- custom data passed to be passed to @parse_name_func, or %NULLparse_name_destroy
- function to be called when unregistering the URI scheme, or when @vfs is disposed, to free the resources used by the parse name lookup function- Returns:
- %TRUE if @scheme was successfully registered, or %FALSE if a handler for @scheme already exists.
-
unregisterUriScheme
Unregisters the URI handler for @scheme previously registered with
g_vfs_register_uri_scheme().- Parameters:
scheme
- an URI scheme, e.g. "http"- Returns:
- %TRUE if @scheme was successfully unregistered, or %FALSE if a handler for @scheme does not exist.
-
unregisterUriScheme
Unregisters the URI handler for @scheme previously registered with
g_vfs_register_uri_scheme().- Parameters:
scheme
- an URI scheme, e.g. "http"- Returns:
- %TRUE if @scheme was successfully unregistered, or %FALSE if a handler for @scheme does not exist.
-
getDefault
Gets the default #GVfs for the system.- Returns:
- a #GVfs, which will be the local file system #GVfs if no other implementation is available.
-
getLocal
Gets the local #GVfs for the system.- Returns:
- a #GVfs.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-