Package com.chilkatsoft.chilkat2
Class ChilkatObject
java.lang.Object
com.chilkatsoft.chilkat2.ChilkatObject
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
Ai,Asn,AuthAws,AuthAzureSAS,AuthAzureStorage,AuthGoogle,BinData,Bz2,Cache,Cert,CertChain,CertStore,Charset,CodeSign,Compression,Crypt2,Csr,Csv,DateTime,Dh,DirTree,Dkim,Dns,Dsa,DtObj,Ecc,EdDSA,Email,EmailBundle,FileAccess,Formats,Ftp2,Global,Gzip,Hashtable,HtmlToText,HtmlToXml,Http,HttpCurl,HttpRequest,HttpResponse,Imap,JavaKeyStore,Js,JsonArray,JsonObject,Jwe,Jws,Jwt,Log,Mailboxes,MailMan,Mcp,MessageSet,Mht,Mime,Ntlm,OAuth1,OAuth2,Pdf,Pem,Pfx,Pkcs11,PrivateKey,Prng,PublicKey,Rest,Rsa,SCard,ScMinidriver,Scp,Secrets,SecureString,ServerSentEvent,SFtp,SFtpDir,SFtpFile,Socket,Spider,Ssh,SshKey,SshTunnel,Stream,StringArray,StringBuilder,StringTable,Tar,TrustedRoots,UnixCompress,Upload,Url,WebSocket,Xml,XmlCertVault,XmlDSig,XmlDSigGen,Xmp,Zip,ZipCrc,ZipEntry
The base class of every Chilkat2 Java class.
An instance owns a native Chilkat object. Release it with close() (try-with-resources is
the idiom); an instance that is never closed is freed by a background cleaner once it becomes
unreachable, but the garbage collector does not see native memory, so close() is the
normal path. After close() every method and property accessor throws
IllegalStateException.
Objects are not thread-safe: use an object from one thread at a time. The one documented
cross-thread operation is setting the AbortCurrent property of an object that is busy in
another thread.
The seven base properties below exist on every class.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases the native Chilkat object.The path of a file to which the library appends its log for every method of this object, or an empty string.The log of the most recent method call as HTML.The log of the most recent method call: what happened and, on failure, why.The log of the most recent method call as XML.booleanWhether the most recent method call succeeded.booleanWhetherLastErrorTextis verbose.The version of the Chilkat library.booleanisClosed()Returns whetherclose()has been called.voidsetDebugLogFilePath(String value)Sets the path of a file to which the library appends its log (empty to turn it off).voidsetLastMethodSuccess(boolean value)Sets the success flag (rarely needed; seegetLastMethodSuccess()).voidsetVerboseLogging(boolean value)Sets whetherLastErrorTextis verbose (more detail; larger logs).toString()A short identification (Http[0x...]); never calls into the library, so it is safe in debuggers and on a closed object.
-
Method Details
-
isClosed
public final boolean isClosed()Returns whetherclose()has been called.- Returns:
- true once this object has been closed
-
close
public void close()Releases the native Chilkat object. Safe to call more than once; every later method or property call throwsIllegalStateException. This frees the object only; it does not disconnect or flush anything a class's own methods would.- Specified by:
closein interfaceAutoCloseable
-
toString
A short identification (Http[0x...]); never calls into the library, so it is safe in debuggers and on a closed object. -
getLastErrorText
The log of the most recent method call: what happened and, on failure, why. Read it right after a call; the next call overwrites it. AChilkatExceptioncarries a copy taken at the moment of failure.- Returns:
- the text log of the last method called on this object
-
getLastErrorHtml
The log of the most recent method call as HTML.- Returns:
- the HTML log of the last method called on this object
-
getLastErrorXml
The log of the most recent method call as XML.- Returns:
- the XML log of the last method called on this object
-
getLastMethodSuccess
public boolean getLastMethodSuccess()Whether the most recent method call succeeded. Methods that report failure by exception set it before throwing; methods returning a plain number set it where their description says so.- Returns:
- the success flag of the last method called on this object
-
setLastMethodSuccess
public void setLastMethodSuccess(boolean value)Sets the success flag (rarely needed; seegetLastMethodSuccess()).- Parameters:
value- the new value
-
getVerboseLogging
public boolean getVerboseLogging()WhetherLastErrorTextis verbose.- Returns:
- the VerboseLogging flag
-
setVerboseLogging
public void setVerboseLogging(boolean value)Sets whetherLastErrorTextis verbose (more detail; larger logs).- Parameters:
value- the new value
-
getDebugLogFilePath
The path of a file to which the library appends its log for every method of this object, or an empty string.- Returns:
- the debug log file path
-
setDebugLogFilePath
Sets the path of a file to which the library appends its log (empty to turn it off).- Parameters:
value- the file path (notnull)
-
getVersion
The version of the Chilkat library.- Returns:
- the library version, such as
11.6.1
-