# JS API Changes of the File Management Subsystem The table below lists the APIs changes of the file management subsystem in OpenHarmony 3.2 Beta3 over OpenHarmony 3.2 Beta2. ## API Changes | Module| Class| Method/Attribute/Enumeration/Constant| Change Type| |---|---|---|---| | ohos.data.fileAccess | FileAccessHelper | getRoots(): Promise\;
getRoots(callback:AsyncCallback\) : void; | Added| | ohos.data.fileAccess | FileAccessHelper | access(sourceFileUri: string) : Promise\;
access(sourceFileUri: string, callback: AsyncCallback\) : void; | Added| | ohos.data.fileAccess | FileAccessHelper | rename(uri: string, displayName: string) : Promise\;
rename(uri: string, displayName: string, callback: AsyncCallback\) : void; | Added| | ohos.data.fileAccess | FileAccessHelper | move(sourceFile: string, destFile: string) : Promise\;
move(sourceFile: string, destFile: string, callback: AsyncCallback\) : void; | Added| | ohos.data.fileAccess | FileAccessHelper | delete(uri: string) : Promise\;
delete(uri: string, callback: AsyncCallback\) : void; | Added| | ohos.data.fileAccess | FileAccessHelper | mkDir(parentUri: string, displayName: string) : Promise\;
mkDir(parentUri: string, displayName: string, callback: AsyncCallback\) : void; | Added| | ohos.data.fileAccess | FileAccessHelper | createFile(uri: string, displayName: string) : Promise\;
createFile(uri: string, displayName: string, callback: AsyncCallback\) : void; | Added| | ohos.data.fileAccess | FileAccessHelper | openFile(uri: string, flags: OPENFLAGS) : Promise\;
openFile(uri: string, flags: OPENFLAGS, callback: AsyncCallback\) : void; | Added| | ohos.data.fileAccess | OPENFLAGS | WRITE_READ = 0o2 | Added| | ohos.data.fileAccess | OPENFLAGS | WRITE = 0o1 | Added| | ohos.data.fileAccess | OPENFLAGS | READ = 0o0 | Added| | ohos.data.fileAccess | RootIterator | next(): {value: RootInfo, done: boolean} | Added| | ohos.data.fileAccess | RootInfo | scanFile(filter?: Filter): FileIterator; | Added| | ohos.data.fileAccess | RootInfo | listFile(filter?: Filter): FileIterator; | Added| | ohos.data.fileAccess | RootInfo | deviceFlags: number; | Added| | ohos.data.fileAccess | RootInfo | displayName: string; | Added| | ohos.data.fileAccess | RootInfo | uri: string; | Added| | ohos.data.fileAccess | RootInfo | deviceType: number; | Added| | ohos.data.fileAccess | FileIterator | next(): {value: FileInfo, done: boolean} | Added| | ohos.data.fileAccess | FileInfo | scanFile(filter?: Filter): FileIterator; | Added| | ohos.data.fileAccess | FileInfo | listFile(filter?: Filter): FileIterator; | Added| | ohos.data.fileAccess | FileInfo | mimeType: string; | Added| | ohos.data.fileAccess | FileInfo | mtime: number; | Added| | ohos.data.fileAccess | FileInfo | size: number; | Added| | ohos.data.fileAccess | FileInfo | mode: number; | Added| | ohos.data.fileAccess | FileInfo | fileName: string; | Added| | ohos.data.fileAccess | FileInfo | uri: string; | Added| | ohos.data.fileAccess | fileAccess | createFileAccessHelper(context: Context): FileAccessHelper;
createFileAccessHelper(context: Context, wants: Array\): FileAccessHelper; | Added| | ohos.data.fileAccess | fileAccess | getFileAccessAbilityInfo(callback: AsyncCallback\>): void;
getFileAccessAbilityInfo(): Promise\>; | Added| | ohos.fileExtensionInfo | DocumentFlag | const SUPPORTS_WRITE = 0b1000; | Added| | ohos.fileExtensionInfo | DocumentFlag | const SUPPORTS_READ = 0b100; | Added| | ohos.fileExtensionInfo | DocumentFlag | const REPRESENTS_DIR = 0b10; | Added| | ohos.fileExtensionInfo | DocumentFlag | const REPRESENTS_FILE = 0b1; | Added| | ohos.fileExtensionInfo | DeviceFlag | const SUPPORTS_WRITE = 0b10; | Added| | ohos.fileExtensionInfo | DeviceFlag | const SUPPORTS_READ = 0b1; | Added| | ohos.fileExtensionInfo | DeviceType | DEVICE_EXTERNAL_CLOUD | Added| | ohos.fileExtensionInfo | DeviceType | DEVICE_EXTERNAL_USB | Added| | ohos.fileExtensionInfo | DeviceType | DEVICE_EXTERNAL_MTP | Added| | ohos.fileExtensionInfo | DeviceType | DEVICE_NETWORK_NEIGHBORHOODS | Added| | ohos.fileExtensionInfo | DeviceType | DEVICE_SHARED_TERMINAL | Added| | ohos.fileExtensionInfo | DeviceType | DEVICE_SHARED_DISK | Added| | ohos.fileExtensionInfo | DeviceType | DEVICE_LOCAL_DISK = 1 | Added| | ohos.filemanagement.userfile_manager | VirtualAlbum | getFileAssets(type: Array\, options: MediaFetchOptions, callback: AsyncCallback\): void;
getFileAssets(type: Array\, options: MediaFetchOptions): Promise\; | Added| | ohos.filemanagement.userfile_manager | VirtualAlbumType | TYPE_TRASH | Added| | ohos.filemanagement.userfile_manager | VirtualAlbumType | TYPE_FAVORITE | Added| | ohos.filemanagement.userfile_manager | PeerInfo | readonly isOnline: boolean; | Added| | ohos.filemanagement.userfile_manager | PeerInfo | readonly networkId: string; | Added| | ohos.filemanagement.userfile_manager | PeerInfo | readonly deviceName: string; | Added| | ohos.filemanagement.userfile_manager | Size | height: number; | Added| | ohos.filemanagement.userfile_manager | Size | width: number; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | release(callback: AsyncCallback\): void;
release(): Promise\; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | getAllPeers(callback: AsyncCallback\>): void;
getAllPeers(): Promise\>; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | getActivePeers(callback: AsyncCallback\>): void;
getActivePeers(): Promise\>; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | getPrivateAlbum(type: VirtualAlbumType, callback: AsyncCallback\>): void;
getPrivateAlbum(type: VirtualAlbumType): Promise\>; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | getAlbums(type: Array\, options: MediaFetchOptions, callback: AsyncCallback\>): void;
getAlbums(type: Array\, options: MediaFetchOptions): Promise\>; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | deleteAsset(uri: string, callback: AsyncCallback\): void;
deleteAsset(uri: string): Promise\; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback\): void;
createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise\; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | getFileAssets(type: Array\, options: MediaFetchOptions, callback: AsyncCallback\): void;
getFileAssets(type: Array\, options: MediaFetchOptions): Promise\; | Added| | ohos.filemanagement.userfile_manager | UserFileManager | getPublicDirectory(type: DirectoryType, callback: AsyncCallback\): void;
getPublicDirectory(type: DirectoryType): Promise\; | Added| | ohos.filemanagement.userfile_manager | DirectoryType | DIR_DOWNLOAD | Added| | ohos.filemanagement.userfile_manager | DirectoryType | DIR_DOCUMENTS | Added| | ohos.filemanagement.userfile_manager | DirectoryType | DIR_AUDIO | Added| | ohos.filemanagement.userfile_manager | DirectoryType | DIR_IMAGE | Added| | ohos.filemanagement.userfile_manager | DirectoryType | DIR_VIDEO | Added| | ohos.filemanagement.userfile_manager | DirectoryType | DIR_CAMERA = 0 | Added| | ohos.filemanagement.userfile_manager | Album | getFileAssets(type: Array\, callback: AsyncCallback\): void;
getFileAssets(type: Array\, options: MediaFetchOptions, callback: AsyncCallback\): void;
getFileAssets(type: Array\, options?: MediaFetchOptions): Promise\; | Added| | ohos.filemanagement.userfile_manager | Album | commitModify(callback: AsyncCallback\): void;
commitModify(): Promise\; | Added| | ohos.filemanagement.userfile_manager | Album | readonly coverUri: string; | Added| | ohos.filemanagement.userfile_manager | Album | readonly relativePath: string; | Added| | ohos.filemanagement.userfile_manager | Album | readonly count: number; | Added| | ohos.filemanagement.userfile_manager | Album | readonly dateModified: number; | Added| | ohos.filemanagement.userfile_manager | Album | readonly albumUri: string; | Added| | ohos.filemanagement.userfile_manager | Album | albumName: string; | Added| | ohos.filemanagement.userfile_manager | FetchFileResult | getPositionObject(index: number, callback: AsyncCallback\): void;
getPositionObject(index: number): Promise\; | Added| | ohos.filemanagement.userfile_manager | FetchFileResult | getLastObject(callback: AsyncCallback\): void;
getLastObject(): Promise\; | Added| | ohos.filemanagement.userfile_manager | FetchFileResult | getNextObject(callback: AsyncCallback\): void;
getNextObject(): Promise\; | Added| | ohos.filemanagement.userfile_manager | FetchFileResult | getFirstObject(callback: AsyncCallback\): void;
getFirstObject(): Promise\; | Added| | ohos.filemanagement.userfile_manager | FetchFileResult | close(): void; | Added| | ohos.filemanagement.userfile_manager | FetchFileResult | isAfterLast(): boolean; | Added| | ohos.filemanagement.userfile_manager | FetchFileResult | getCount(): number; | Added| | ohos.filemanagement.userfile_manager | MediaFetchOptions | selectionArgs: Array\; | Added| | ohos.filemanagement.userfile_manager | MediaFetchOptions | selections: string; | Added| | ohos.filemanagement.userfile_manager | AlbumKey | DATE_MODIFIED = "date_modified" | Added| | ohos.filemanagement.userfile_manager | AlbumKey | DATE_ADDED = "date_added" | Added| | ohos.filemanagement.userfile_manager | AlbumKey | DISPLAY_NAME = "display_name" | Added| | ohos.filemanagement.userfile_manager | AlbumKey | RELATIVE_PATH = "relative_path" | Added| | ohos.filemanagement.userfile_manager | AlbumKey | URI = "uri" | Added| | ohos.filemanagement.userfile_manager | ImageVideoKey | DATE_TAKEN = "date_taken" | Added| | ohos.filemanagement.userfile_manager | ImageVideoKey | HEIGHT = "height" | Added| | ohos.filemanagement.userfile_manager | ImageVideoKey | WIDTH = "width" | Added| | ohos.filemanagement.userfile_manager | ImageVideoKey | DURATION = "duration" | Added| | ohos.filemanagement.userfile_manager | ImageVideoKey | TITLE = "title" | Added| | ohos.filemanagement.userfile_manager | ImageVideoKey | DATE_MODIFIED = "date_modified" | Added| | ohos.filemanagement.userfile_manager | ImageVideoKey | DATE_ADDED = "date_added" | Added| | ohos.filemanagement.userfile_manager | ImageVideoKey | DISPLAY_NAME = "display_name" | Added| | ohos.filemanagement.userfile_manager | ImageVideoKey | RELATIVE_PATH = "relative_path" | Added| | ohos.filemanagement.userfile_manager | ImageVideoKey | URI = "uri" | Added| | ohos.filemanagement.userfile_manager | AudioKey | DURATION = "duration" | Added| | ohos.filemanagement.userfile_manager | AudioKey | AUDIOALBUM = "audio_album" | Added| | ohos.filemanagement.userfile_manager | AudioKey | ARTIST = "artist" | Added| | ohos.filemanagement.userfile_manager | AudioKey | TITLE = "title" | Added| | ohos.filemanagement.userfile_manager | AudioKey | DATE_MODIFIED = "date_modified" | Added| | ohos.filemanagement.userfile_manager | AudioKey | DATE_ADDED = "date_added" | Added| | ohos.filemanagement.userfile_manager | AudioKey | DISPLAY_NAME = "display_name" | Added| | ohos.filemanagement.userfile_manager | AudioKey | RELATIVE_PATH = "relative_path" | Added| | ohos.filemanagement.userfile_manager | AudioKey | URI = "uri" | Added| | ohos.filemanagement.userfile_manager | FileKey | TITLE = "title" | Added| | ohos.filemanagement.userfile_manager | FileKey | DATE_MODIFIED = "date_modified" | Added| | ohos.filemanagement.userfile_manager | FileKey | DATE_ADDED = "date_added" | Added| | ohos.filemanagement.userfile_manager | FileKey | DISPLAY_NAME = "display_name" | Added| | ohos.filemanagement.userfile_manager | FileKey | RELATIVE_PATH = "relative_path" | Added| | ohos.filemanagement.userfile_manager | FileKey | URI = "uri" | Added| | ohos.filemanagement.userfile_manager | FileAsset | isTrash(callback: AsyncCallback\): void;
isTrash():Promise\; | Added| | ohos.filemanagement.userfile_manager | FileAsset | trash(isTrash: boolean, callback: AsyncCallback\): void;
trash(isTrash: boolean): Promise\; | Added| | ohos.filemanagement.userfile_manager | FileAsset | isFavorite(callback: AsyncCallback\): void;
isFavorite():Promise\; | Added| | ohos.filemanagement.userfile_manager | FileAsset | favorite(isFavorite: boolean, callback: AsyncCallback\): void;
favorite(isFavorite: boolean): Promise\; | Added| | ohos.filemanagement.userfile_manager | FileAsset | getThumbnail(callback: AsyncCallback\): void;
getThumbnail(size: Size, callback: AsyncCallback\): void;
getThumbnail(size?: Size): Promise\; | Added| | ohos.filemanagement.userfile_manager | FileAsset | close(fd: number, callback: AsyncCallback\): void;
close(fd: number): Promise\; | Added| | ohos.filemanagement.userfile_manager | FileAsset | open(mode: string, callback: AsyncCallback\): void;
open(mode: string): Promise\; | Added| | ohos.filemanagement.userfile_manager | FileAsset | commitModify(callback: AsyncCallback\): void;
commitModify(): Promise\; | Added| | ohos.filemanagement.userfile_manager | FileAsset | isDirectory(callback: AsyncCallback\): void;
isDirectory():Promise\; | Added| | ohos.filemanagement.userfile_manager | FileAsset | displayName: string; | Added| | ohos.filemanagement.userfile_manager | FileAsset | readonly mediaType: MediaType; | Added| | ohos.filemanagement.userfile_manager | FileAsset | readonly uri: string; | Added| | ohos.filemanagement.userfile_manager | MediaType | AUDIO | Added| | ohos.filemanagement.userfile_manager | MediaType | VIDEO | Added| | ohos.filemanagement.userfile_manager | MediaType | IMAGE | Added| | ohos.filemanagement.userfile_manager | MediaType | FILE = 0 | Added| | ohos.filemanagement.userfile_manager | userfile_manager | getUserFileMgr(): UserFileManager;
getUserFileMgr(context: Context): UserFileManager; | Added| | ohos.document | document | show(uri: string, type: string): Promise\;
show(uri: string, type: string, callback: AsyncCallback\): void; | Deprecated| | ohos.document | document | choose(types?: string[]): Promise\;
choose(callback: AsyncCallback\): void;
choose(types: string[], callback: AsyncCallback\): void; | Deprecated|