@@ -29,7 +29,6 @@ import { FileResult } from 'tmp';
29
29
import { URL } from 'url' ;
30
30
import * as isPort from 'validator/lib/isPort' ;
31
31
import * as vscode from 'vscode' ;
32
- import * as vscodeUri from 'vscode-uri' ;
33
32
import { OpenDialogOptions , MessageOptions , OutputChannel , QuickPickItem , MessageItem , Uri , DebugConfiguration , WorkspaceFolder } from 'vscode' ;
34
33
import { ApplicationInstance } from '../project/ApplicationInstance' ;
35
34
import { DeploymentSupport } from '../project/DeploymentSupport' ;
@@ -866,11 +865,11 @@ export class PayaraServerInstanceController extends PayaraInstanceController {
866
865
this . instanceProvider . updateServerConfig ( ) ;
867
866
}
868
867
869
- public async migrateToJakarta10 ( uri : string ) {
870
- console . log ( "selected resource:" + vscodeUri . URI . parse ( uri ) . fsPath ) ;
868
+ public async migrateToJakarta10 ( uri : vscode . Uri ) {
869
+ console . log ( "selected resource:" + uri . fsPath ) ;
871
870
872
871
//verify if the source is a directory
873
- if ( uri && fs . existsSync ( vscodeUri . URI . parse ( uri ) . fsPath ) && fs . lstatSync ( vscodeUri . URI . parse ( uri ) . fsPath ) . isDirectory ( ) ) {
872
+ if ( uri && fs . existsSync ( uri . fsPath ) && fs . lstatSync ( uri . fsPath ) . isDirectory ( ) ) {
874
873
//request to select the folder
875
874
let directorySelected = await vscode . window . showOpenDialog ( {
876
875
canSelectFolders : true ,
@@ -896,7 +895,7 @@ export class PayaraServerInstanceController extends PayaraInstanceController {
896
895
}
897
896
898
897
//if it is the same folder show dialog for override selection
899
- if ( directorySelected && directorySelected [ 0 ] . fsPath == vscodeUri . URI . parse ( uri . toString ( ) ) . fsPath ) {
898
+ if ( directorySelected && directorySelected [ 0 ] . fsPath == uri . fsPath ) {
900
899
let options : vscode . MessageOptions = {
901
900
modal : true
902
901
} ;
@@ -910,12 +909,12 @@ export class PayaraServerInstanceController extends PayaraInstanceController {
910
909
}
911
910
912
911
//if selection was cancel or no just return
913
- if ( directorySelected && directorySelected [ 0 ] . fsPath == vscodeUri . URI . parse ( uri . toString ( ) ) . fsPath && selectedCancelorNo ) {
912
+ if ( directorySelected && directorySelected [ 0 ] . fsPath == uri . fsPath && selectedCancelorNo ) {
914
913
return ;
915
914
}
916
915
917
916
//processing the options selected for the transform process
918
- let source = vscodeUri . URI . parse ( uri ) . fsPath ;
917
+ let source = uri . fsPath ;
919
918
let workspaceFolder : vscode . WorkspaceFolder = {
920
919
uri : ( vscode . workspace . rootPath ? vscode . Uri . file ( vscode . workspace . rootPath ) : undefined ) ,
921
920
name : "name" ,
@@ -945,7 +944,7 @@ export class PayaraServerInstanceController extends PayaraInstanceController {
945
944
console . log ( item ) ;
946
945
} ) ;
947
946
948
- } else if ( uri && fs . existsSync ( vscodeUri . URI . parse ( uri ) . fsPath ) && fs . lstatSync ( vscodeUri . URI . parse ( uri ) . fsPath ) . isFile ( ) ) {
947
+ } else if ( uri && fs . existsSync ( uri . fsPath ) && fs . lstatSync ( uri . fsPath ) . isFile ( ) ) {
949
948
//request to select the folder
950
949
let directorySelected = await vscode . window . showOpenDialog ( {
951
950
canSelectFolders : true ,
@@ -971,7 +970,7 @@ export class PayaraServerInstanceController extends PayaraInstanceController {
971
970
}
972
971
973
972
//if it is the same file on the same folder show dialog for override selection
974
- if ( directorySelected && directorySelected [ 0 ] . fsPath == vscodeUri . URI . parse ( path . parse ( uri . toString ( ) ) . dir ) . fsPath ) {
973
+ if ( directorySelected && directorySelected [ 0 ] . fsPath == vscode . Uri . file ( path . parse ( uri . toString ( ) ) . dir ) . fsPath ) {
975
974
let options : vscode . MessageOptions = {
976
975
modal : true
977
976
} ;
@@ -985,20 +984,20 @@ export class PayaraServerInstanceController extends PayaraInstanceController {
985
984
}
986
985
987
986
//if selection was cancel or no just return
988
- if ( directorySelected && directorySelected [ 0 ] . fsPath == vscodeUri . URI . parse ( path . parse ( uri . toString ( ) ) . dir ) . fsPath && selectedCancelorNo ) {
987
+ if ( directorySelected && directorySelected [ 0 ] . fsPath == vscode . Uri . file ( path . parse ( uri . toString ( ) ) . dir ) . fsPath && selectedCancelorNo ) {
989
988
return ;
990
989
}
991
990
992
991
//processing the options selected for the transform process
993
- let source = vscodeUri . URI . parse ( uri ) . fsPath ;
992
+ let source = uri . fsPath ;
994
993
let workspaceFolder : vscode . WorkspaceFolder = {
995
994
uri : ( vscode . workspace . rootPath ? vscode . Uri . file ( vscode . workspace . rootPath ) : undefined ) ,
996
995
name : "name" ,
997
996
index : 0
998
997
} ;
999
998
1000
999
let finalNameFile = "" ;
1001
- finalNameFile = path . join ( directorySelected [ 0 ] . fsPath , path . parse ( vscodeUri . URI . parse ( uri ) . fsPath ) . base ) ;
1000
+ finalNameFile = path . join ( directorySelected [ 0 ] . fsPath , path . parse ( uri . fsPath ) . base ) ;
1002
1001
1003
1002
let mvn = new Maven ( null , workspaceFolder ) ;
1004
1003
let result = await mvn . migrateToJakarta10 ( async ( code : number ) => {
0 commit comments