com.yoctopuce.YoctoAPI
public class YFiles extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YFiles.TimedReportCallback
TimedReportCallback for Files
|
static interface |
YFiles.UpdateCallback
Deprecated UpdateCallback for Files
|
Modifier and Type | Field and Description |
---|---|
protected int |
_filesCount |
protected int |
_freeSpace |
protected YFiles.UpdateCallback |
_valueCallbackFiles |
static int |
FILESCOUNT_INVALID
invalid filesCount value
|
static int |
FREESPACE_INVALID
invalid freeSpace value
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
byte[] |
download(String pathname)
Downloads the requested file and returns a binary buffer with its content.
|
static YFiles |
FindFiles(String func)
Retrieves a filesystem for a given identifier.
|
static YFiles |
FirstFiles()
Starts the enumeration of filesystems currently accessible.
|
int |
format_fs()
Reinitialize the filesystem to its clean, unfragmented, empty state.
|
int |
get_filesCount()
Returns the number of files currently loaded in the filesystem.
|
int |
get_freeSpace()
Returns the free space for uploading new files to the filesystem, in bytes.
|
ArrayList<YFileRecord> |
get_list(String pattern)
Returns a list of YFileRecord objects that describe files currently loaded
in the filesystem.
|
int |
getFilesCount()
Returns the number of files currently loaded in the filesystem.
|
int |
getFreeSpace()
Returns the free space for uploading new files to the filesystem, in bytes.
|
YFiles |
nextFiles()
Continues the enumeration of filesystems started using yFirstFiles().
|
int |
registerValueCallback(YFiles.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
remove(String pathname)
Deletes a file, given by its full path name, from the filesystem.
|
byte[] |
sendCommand(String command) |
int |
upload(String pathname,
byte[] content)
Uploads a file to the filesystem, to the specified full path name.
|
_AddToCache, _devRequest, _download, _escapeAttr, _FindFromCache, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, describe, errMessage, errorMessage, errorType, errType, FindFunction, FirstFunction, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, module, nextFunction, registerValueCallback, set_logicalName, set_userData, setLogicalName, setUserData, toString, userData
public static final int FILESCOUNT_INVALID
public static final int FREESPACE_INVALID
protected int _filesCount
protected int _freeSpace
protected YFiles.UpdateCallback _valueCallbackFiles
protected YFiles(String func)
func
- : functionidprotected void _parseAttr(org.json.JSONObject json_val) throws org.json.JSONException
_parseAttr
in class YFunction
org.json.JSONException
public int get_filesCount() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getFilesCount() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_freeSpace() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getFreeSpace() throws YAPI_Exception
YAPI_Exception
- on errorpublic static YFiles FindFiles(String func)
func
- : a string that uniquely characterizes the filesystempublic int registerValueCallback(YFiles.UpdateCallback callback)
callback
- : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and the character string describing
the new advertised value.public int _invokeValueCallback(String value)
_invokeValueCallback
in class YFunction
public byte[] sendCommand(String command) throws YAPI_Exception
YAPI_Exception
public int format_fs() throws YAPI_Exception
YAPI_Exception
- on errorpublic ArrayList<YFileRecord> get_list(String pattern) throws YAPI_Exception
pattern
- : an optional filter pattern, using star and question marks
as wildcards. When an empty pattern is provided, all file records
are returned.YAPI_Exception
- on errorpublic byte[] download(String pathname) throws YAPI_Exception
pathname
- : path and name of the file to downloadYAPI_Exception
- on errorpublic int upload(String pathname, byte[] content) throws YAPI_Exception
pathname
- : path and name of the new file to createcontent
- : binary buffer with the content to setYAPI_Exception
- on errorpublic int remove(String pathname) throws YAPI_Exception
pathname
- : path and name of the file to remove.YAPI_Exception
- on errorpublic YFiles nextFiles()
public static YFiles FirstFiles()
Copyright © 2014. All rights reserved.