/**@class android.os.FileUtils @extends java.lang.Object Tools for managing files. Not for public consumption. @hide */ var FileUtils = { /***/ S_IRWXU : "448", /***/ S_IRUSR : "256", /***/ S_IWUSR : "128", /***/ S_IXUSR : "64", /***/ S_IRWXG : "56", /***/ S_IRGRP : "32", /***/ S_IWGRP : "16", /***/ S_IXGRP : "8", /***/ S_IRWXO : "7", /***/ S_IROTH : "4", /***/ S_IWOTH : "2", /***/ S_IXOTH : "1", /**Set owner and mode of of given {@link File}. @param {Object {File}} mode to apply through {@code chmod} @param {Number} uid to apply through {@code chown}, or -1 to leave unchanged @param {Number} gid to apply through {@code chown}, or -1 to leave unchanged @return {Number} 0 on success, otherwise errno. */ setPermissions : function( ) {}, /**Set owner and mode of of given path. @param {String} mode to apply through {@code chmod} @param {Number} uid to apply through {@code chown}, or -1 to leave unchanged @param {Number} gid to apply through {@code chown}, or -1 to leave unchanged @return {Number} 0 on success, otherwise errno. */ setPermissions : function( ) {}, /**Set owner and mode of of given {@link FileDescriptor}. @param {Object {FileDescriptor}} mode to apply through {@code chmod} @param {Number} uid to apply through {@code chown}, or -1 to leave unchanged @param {Number} gid to apply through {@code chown}, or -1 to leave unchanged @return {Number} 0 on success, otherwise errno. */ setPermissions : function( ) {}, /**Return owning UID of given path, otherwise -1. */ getUid : function( ) {}, /**Perform an fsync on the given FileOutputStream. The stream at this point must be flushed but not yet closed. */ sync : function( ) {}, /** */ copyFile : function( ) {}, /**Copy data from a source stream to destFile. Return true if succeed, return false if failed. */ copyToFile : function( ) {}, /**Check if a filename is "safe" (no metacharacters or spaces). @param {Object {File}} file The file to check */ isFilenameSafe : function( ) {}, /**Read a text file into a String, optionally limiting the length. @param {Object {File}} file to read (will not seek, so things like /proc files are OK) @param {Number} max length (positive for head, negative of tail, 0 for no limit) @param {String} ellipsis to add of the file was truncated (can be null) @return {String} the contents of the file, possibly truncated @throws IOException if something goes wrong reading the file */ readTextFile : function( ) {}, /**Writes string to file. Basically same as "echo -n $string > $filename" @param {String} filename @param {String} string @throws IOException */ stringToFile : function( ) {}, /**Computes the checksum of a file using the CRC32 checksum routine. The value of the checksum is returned. @param {Object {File}} file the file to checksum, must not be null @return {Number} the checksum value or an exception is thrown. */ checksumCrc32 : function( ) {}, /**Delete older files in a directory until only those matching the given constraints remain. @param {Object {File}} minCount Always keep at least this many files. @param {Number} minAge Always keep files younger than this age. @return {Boolean} if any files were deleted. */ deleteOlderFiles : function( ) {}, /**Test if a file lives under the given directory, either as a direct child or a distant grandchild. <p> Both files <em>must</em> have been resolved using {@link File#getCanonicalFile()} to avoid symlink or path traversal attacks. */ contains : function( ) {}, /**Test if a file lives under the given directory, either as a direct child or a distant grandchild. <p> Both files <em>must</em> have been resolved using {@link File#getCanonicalFile()} to avoid symlink or path traversal attacks. */ contains : function( ) {}, /** */ deleteContents : function( ) {}, /**Check if given filename is valid for an ext4 filesystem. */ isValidExtFilename : function( ) {}, /**Mutate the given filename to make it valid for an ext4 filesystem, replacing any invalid characters with "_". */ buildValidExtFilename : function( ) {}, /**Check if given filename is valid for a FAT filesystem. */ isValidFatFilename : function( ) {}, /**Mutate the given filename to make it valid for a FAT filesystem, replacing any invalid characters with "_". */ buildValidFatFilename : function( ) {}, /** */ trimFilename : function( ) {}, /** */ rewriteAfterRename : function( ) {}, /** */ rewriteAfterRename : function( ) {}, /**Given a path under the "before" directory, rewrite it to live under the "after" directory. For example, {@code /before/foo/bar.txt} would become {@code /after/foo/bar.txt}. */ rewriteAfterRename : function( ) {}, /**Generates a unique file name under the given parent directory. If the display name doesn't have an extension that matches the requested MIME type, the default extension for that MIME type is appended. If a file already exists, the name is appended with a numerical value to make it unique. For example, the display name 'example' with 'text/plain' MIME might produce 'example.txt' or 'example (1).txt', etc. @throws FileNotFoundException */ buildUniqueFile : function( ) {}, /** */ listFilesOrEmpty : function( ) {}, };