Class ContentSniffer
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gobject.GObject
org.gnome.soup.ContentSniffer
- All Implemented Interfaces:
SessionFeature, Proxy
@Generated("org.javagi.JavaGI")
public final class ContentSniffer
extends GObject
implements SessionFeature
Sniffs the mime type of messages.
A ContentSniffer tries to detect the actual content type of
the files that are being downloaded by looking at some of the data
before the Message emits its Message::got-headers signal.
ContentSniffer implements SessionFeature, so you can add
content sniffing to a session with Session.addFeature(SessionFeature) or
Session.addFeatureByType(Type).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContentSniffer.Builder<B extends ContentSniffer.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface SessionFeature
SessionFeature.SessionFeature$Impl, SessionFeature.SessionFeatureInterface -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new ContentSniffer.ContentSniffer(MemorySegment address) Create a ContentSniffer instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ContentSnifferasParent()Return this instance as if it were its parent type.static ContentSniffer.Builder<? extends ContentSniffer.Builder> builder()AContentSniffer.Builderobject constructs aContentSnifferwith the specified properties.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the ContentSniffer class.Sniffsbufferto determine its Content-Type.Methods inherited from class 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 TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ContentSniffer
Create a ContentSniffer instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
ContentSniffer
public ContentSniffer()Create a new ContentSniffer.
-
-
Method Details
-
getType
Get the GType of the ContentSniffer class.- Returns:
- the GType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
sniff
Sniffs
bufferto determine its Content-Type.The result may also be influenced by the Content-Type declared in
msg'sresponse headers.- Parameters:
msg- the message to sniffbuffer- a buffer containing the start ofmsg'sresponse bodyparams- return location for Content-Type parameters (eg, "charset"), ornull- Returns:
- the sniffed Content-Type of
buffer;this will never benull, but may beapplication/octet-stream.
-
builder
AContentSniffer.Builderobject constructs aContentSnifferwith the specified properties. Use the variousset...()methods to set properties, and finish construction withContentSniffer.Builder.build().- Returns:
- the builder object
-