com.supermap.realspace
Class DownloadManager
- java.lang.Object
-
- com.supermap.data.InternalHandle
-
- com.supermap.data.InternalHandleDisposable
-
- com.supermap.realspace.DownloadManager
-
public class DownloadManager extends InternalHandleDisposable
This class defines the offline download manager.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interfaceDownloadManager.DownloadManagerListenerBuild a download progress listener.
-
Constructor Summary
Constructors Constructor and Description DownloadManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voidaddProgressListener(ProgressListener listener)Deprecated.Add a download progress listener.booleanClearCacheFile(java.lang.String sceneUrl)Clear the entire 3D scene resource cache data that has been downloaded.booleanClearCacheFile(java.lang.String sceneUrl, java.lang.String layerName)Clear cached data for a layer in the scene.voidcontinueDownload(java.lang.String url, java.lang.String layerName)Continue to download.voiddispose()Release resources.voiddownLoad()Download the DownloadManager object to specify all the data for the layer.longgetDataSize()Deprecated.Get the size of the layer data that the DownloadManager object has loaded.longgetDownloadedSize()Deprecated.Get the size of the downloaded layer data.static DownloadManagergetDownloadManager(android.content.Context context)Get the unique singleton object of DownloadManager.static DownloadManagergetManager()Deprecated.Replace with getDownloadManager(Context context). Used to get the DownloadManager class instance object.booleanloadWithUrl(java.lang.String sceneUrl, java.lang.String sceneName)Deprecated.Read resource file information such as symbols according to the specified 3D service address and the specified scene name.booleanloadWithUrl(java.lang.String sceneUrl, java.lang.String layerName, java.lang.String token)Read layer file information based on the specified 3D service address, and the specified layer name and token.voidpauseDownload(java.lang.String url, java.lang.String layerName)Pause the download.voidsetDownloadManagerListener(DownloadManager.DownloadManagerListener listener)Set the download progress listener.voidstopDownload()Deprecated.Stop downloading data.
-
-
-
Method Detail
-
getManager
public static DownloadManager getManager()
Deprecated. Replace with getDownloadManager(Context context). Used to get the DownloadManager class instance object.- Returns:
- Return the DownloadManager class instance object
-
getDownloadManager
public static DownloadManager getDownloadManager(android.content.Context context)
Get the unique singleton object of DownloadManager.- Parameters:
context- Context.- Returns:
- Returns the DownloadManager class instance object.
-
loadWithUrl
public boolean loadWithUrl(java.lang.String sceneUrl, java.lang.String layerName, java.lang.String token)Read layer file information based on the specified 3D service address, and the specified layer name and token.- Parameters:
sceneUrl- Service address to which the 3D scene belongs.http....rest/realspace.layerName- The given layer name.token- if the service does not have a token, it is empty.- Returns:
- Whether the file is read successfully, returns true if successful, and false returns.
-
loadWithUrl
public boolean loadWithUrl(java.lang.String sceneUrl, java.lang.String sceneName)Deprecated. Read resource file information such as symbols according to the specified 3D service address and the specified scene name.- Parameters:
sceneUrl- The service address to which the 3D scene belongs.sceneName- The given scene name.- Returns:
- Whether the file is read successfully, returns true if successful, and false returns.
-
downLoad
public void downLoad()
Download the DownloadManager object to specify all the data for the layer.
-
stopDownload
public void stopDownload()
Deprecated. Stop downloading data.
-
getDataSize
public long getDataSize()
Deprecated. Get the size of the layer data that the DownloadManager object has loaded.- Returns:
- The size of the layer data that has been loaded, in bytes.
-
getDownloadedSize
public long getDownloadedSize()
Deprecated. Get the size of the downloaded layer data.- Returns:
- The size of the downloaded layer data.
-
pauseDownload
public void pauseDownload(java.lang.String url, java.lang.String layerName)Pause the download.- Parameters:
url- The service address to which the 3D scene belongs.layerName- The name of the layer to delete.
-
continueDownload
public void continueDownload(java.lang.String url, java.lang.String layerName)Continue to download.- Parameters:
url- The service address to which the 3D scene belongs.layerName- The name of the layer to delete.
-
ClearCacheFile
public boolean ClearCacheFile(java.lang.String sceneUrl, java.lang.String layerName)Clear cached data for a layer in the scene.- Parameters:
sceneUrl- The service address to which the 3D scene belongs.layerName- The name of the layer to delete.- Returns:
- Whether the removal is successful.
-
ClearCacheFile
public boolean ClearCacheFile(java.lang.String sceneUrl)
Clear the entire 3D scene resource cache data that has been downloaded.- Parameters:
sceneUrl- The service address to which the 3D scene belongs.- Returns:
- Whether the removal is successful.
-
setDownloadManagerListener
public void setDownloadManagerListener(DownloadManager.DownloadManagerListener listener)
Set the download progress listener.- Parameters:
listener- the download progress listener
-
addProgressListener
public void addProgressListener(ProgressListener listener)
Deprecated. Add a download progress listener.- Parameters:
listener- Download the progress listener.
-
dispose
public void dispose()
Release resources.
-
-