@@ -102,7 +102,7 @@ func (c *JavaPlugin) Run(cliConnection plugin.CliConnection, args []string) {
102102 fmt .Printf ("[VERBOSE] Run called with args: %v\n " , args )
103103 }
104104
105- _ , err := c .DoRun (& commandExecutorImpl {cliConnection : cliConnection }, & uuidGeneratorImpl {}, utils. CfJavaPluginUtilImpl {}, args )
105+ _ , err := c .DoRun (& commandExecutorImpl {cliConnection : cliConnection }, & uuidGeneratorImpl {}, args )
106106 if err != nil {
107107 if c .verbose {
108108 fmt .Printf ("[VERBOSE] Error occurred: %v\n " , err )
@@ -115,15 +115,15 @@ func (c *JavaPlugin) Run(cliConnection plugin.CliConnection, args []string) {
115115}
116116
117117// DoRun is an internal method that we use to wrap the cmd package with CommandExecutor for test purposes
118- func (c * JavaPlugin ) DoRun (commandExecutor cmd.CommandExecutor , uuidGenerator UUIDGenerator , util utils. CfJavaPluginUtil , args []string ) (string , error ) {
118+ func (c * JavaPlugin ) DoRun (commandExecutor cmd.CommandExecutor , uuidGenerator UUIDGenerator , args []string ) (string , error ) {
119119 traceLogger := trace .NewLogger (os .Stdout , true , os .Getenv ("CF_TRACE" ), "" )
120120 ui := terminal .NewUI (os .Stdin , os .Stdout , terminal .NewTeePrinter (os .Stdout ), traceLogger )
121121
122122 if c .verbose {
123123 fmt .Printf ("[VERBOSE] DoRun called with args: %v\n " , args )
124124 }
125125
126- output , err := c .execute (commandExecutor , uuidGenerator , util , args )
126+ output , err := c .execute (commandExecutor , uuidGenerator , args )
127127 if err != nil {
128128 if err .Error () == "unexpected EOF" {
129129 return output , err
@@ -486,7 +486,7 @@ func toSentenceCase(input string) string {
486486 return strings .ToUpper (string (input [0 ])) + strings .ToLower (input [1 :])
487487}
488488
489- func (c * JavaPlugin ) execute (commandExecutor cmd.CommandExecutor , uuidGenerator UUIDGenerator , util utils. CfJavaPluginUtil , args []string ) (string , error ) {
489+ func (c * JavaPlugin ) execute (commandExecutor cmd.CommandExecutor , uuidGenerator UUIDGenerator , args []string ) (string , error ) {
490490 if len (args ) == 0 {
491491 return "" , & InvalidUsageError {message : "No command provided" }
492492 }
@@ -632,7 +632,7 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
632632
633633 logVerbose ("CF SSH arguments: %v" , cfSSHArguments )
634634
635- supported , err := util .CheckRequiredTools (applicationName )
635+ supported , err := utils .CheckRequiredTools (applicationName )
636636
637637 if err != nil || ! supported {
638638 return "required tools checking failed" , err
@@ -665,7 +665,7 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
665665 // Initialize fspath and fileName for commands that need them
666666 if command .GenerateFiles || command .NeedsFileName || command .GenerateArbitraryFiles {
667667 logVerbose ("Command requires file generation" )
668- fspath , err = util .GetAvailablePath (applicationName , remoteDir )
668+ fspath , err = utils .GetAvailablePath (applicationName , remoteDir )
669669 if err != nil {
670670 return "" , fmt .Errorf ("failed to get available path: %w" , err )
671671 }
@@ -740,10 +740,10 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
740740 switch command .FileExtension {
741741 case ".hprof" :
742742 logVerbose ("Finding heap dump file" )
743- finalFile , err = util .FindHeapDumpFile (cfSSHArguments , fileName , fspath )
743+ finalFile , err = utils .FindHeapDumpFile (cfSSHArguments , fileName , fspath )
744744 case ".jfr" :
745745 logVerbose ("Finding JFR file" )
746- finalFile , err = util .FindJFRFile (cfSSHArguments , fileName , fspath )
746+ finalFile , err = utils .FindJFRFile (cfSSHArguments , fileName , fspath )
747747 default :
748748 return "" , & InvalidUsageError {message : fmt .Sprintf ("Unsupported file extension %q" , command .FileExtension )}
749749 }
@@ -759,7 +759,7 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
759759
760760 localFileFullPath := localDir + "/" + applicationName + "-" + command .FileNamePart + "-" + uuidGenerator .Generate () + command .FileExtension
761761 logVerbose ("Downloading file to: %s" , localFileFullPath )
762- err = util .CopyOverCat (cfSSHArguments , fileName , localFileFullPath )
762+ err = utils .CopyOverCat (cfSSHArguments , fileName , localFileFullPath )
763763 if err == nil {
764764 logVerbose ("File download completed successfully" )
765765 fmt .Println (toSentenceCase (command .FileLabel ) + " file saved to: " + localFileFullPath )
@@ -770,7 +770,7 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
770770
771771 if ! keepAfterDownload {
772772 logVerbose ("Deleting remote file" )
773- err = util .DeleteRemoteFile (cfSSHArguments , fileName )
773+ err = utils .DeleteRemoteFile (cfSSHArguments , fileName )
774774 if err != nil {
775775 logVerbose ("Failed to delete remote file: %v" , err )
776776 return "" , err
@@ -785,7 +785,7 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
785785 logVerbose ("Processing arbitrary files download: %s" , fspath )
786786 logVerbose ("cfSSHArguments: %v" , cfSSHArguments )
787787 // download all files in the generic folder
788- files , err := util .ListFiles (cfSSHArguments , fspath )
788+ files , err := utils .ListFiles (cfSSHArguments , fspath )
789789 for i , file := range files {
790790 logVerbose ("File %d: %s" , i + 1 , file )
791791 }
@@ -798,7 +798,7 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
798798 for _ , file := range files {
799799 logVerbose ("Downloading file: %s" , file )
800800 localFileFullPath := localDir + "/" + file
801- err = util .CopyOverCat (cfSSHArguments , fspath + "/" + file , localFileFullPath )
801+ err = utils .CopyOverCat (cfSSHArguments , fspath + "/" + file , localFileFullPath )
802802 if err == nil {
803803 logVerbose ("File %s downloaded successfully" , file )
804804 fmt .Printf ("File %s saved to: %s\n " , file , localFileFullPath )
@@ -810,7 +810,7 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
810810
811811 if ! keepAfterDownload {
812812 logVerbose ("Deleting remote file folder" )
813- err = util .DeleteRemoteFile (cfSSHArguments , fspath )
813+ err = utils .DeleteRemoteFile (cfSSHArguments , fspath )
814814 if err != nil {
815815 logVerbose ("Failed to delete remote folder: %v" , err )
816816 return "" , err
@@ -897,7 +897,7 @@ func (c *JavaPlugin) GetMetadata() plugin.PluginMetadata {
897897 }
898898}
899899
900- // Unlike most Go programs, the `Main ()` function will not be used to run all of the
900+ // Unlike most Go programs, the `main ()` function will not be used to run all of the
901901// commands provided in your plugin. Main will be used to initialize the plugin
902902// process, as well as any dependencies you might require for your
903903// plugin.
0 commit comments