@ -150,6 +150,14 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
}
}
}
}
private String createLocalReuFilename ( ) {
String filename = widget . getFileLoca ( ) ;
if ( StringUtils . isEmpty ( filename ) | | ! filename . endsWith ( ".reu" ) ) {
filename = widget . getName ( ) + "." + widget . getUuid ( ) + ".reu" ;
}
return filename ;
}
private void downLoadWidget ( ) {
private void downLoadWidget ( ) {
if ( OnlineWidgetRepoPane . getInstance ( ) . isShowPackagePanel ( ) ) {
if ( OnlineWidgetRepoPane . getInstance ( ) . isShowPackagePanel ( ) ) {
ComponentCollector . getInstance ( ) . collectDownloadPktNum ( ) ;
ComponentCollector . getInstance ( ) . collectDownloadPktNum ( ) ;
@ -170,7 +178,8 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
protected Boolean doInBackground ( ) {
protected Boolean doInBackground ( ) {
String filePath ;
String filePath ;
try {
try {
filePath = DownloadUtils . download ( widget . getId ( ) , widget . getName ( ) + "." + widget . getUuid ( ) , process ) ;
String filename = createLocalReuFilename ( ) ;
filePath = DownloadUtils . download ( widget . getId ( ) , filename , process ) ;
} catch ( Exception e ) {
} catch ( Exception e ) {
FineLoggerFactory . getLogger ( ) . error ( e . getMessage ( ) , e ) ;
FineLoggerFactory . getLogger ( ) . error ( e . getMessage ( ) , e ) ;
return false ;
return false ;
@ -179,7 +188,7 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
//安装
//安装
File file = new File ( filePath ) ;
File file = new File ( filePath ) ;
try {
try {
if ( file . exists ( ) & & getDefaultGroup ( ) . installModule ( file ) ) {
if ( file . exists ( ) & & getDefaultGroup ( ) . installUniqueId Module ( file ) ) {
ShareUtils . recordInstallTime ( file . getName ( ) , System . currentTimeMillis ( ) ) ;
ShareUtils . recordInstallTime ( file . getName ( ) , System . currentTimeMillis ( ) ) ;
ComponentCollector . getInstance ( ) . collectCmpDownLoad ( widget . getUuid ( ) ) ;
ComponentCollector . getInstance ( ) . collectCmpDownLoad ( widget . getUuid ( ) ) ;
}
}