-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Garlapati Anil Masthan Setty
committed
Nov 18, 2024
1 parent
1bcfbdd
commit dff7b6b
Showing
17 changed files
with
129 additions
and
27 deletions.
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
src/main/groovy/com/urbancode/air/plugin/tool/AirPluginTool.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package com.urbancode.air.plugin.tool | ||
|
||
/** | ||
* © Copyright IBM Corporation 2016, 2024. | ||
* This is licensed under the following license. | ||
* The Eclipse Public 1.0 License (http://www.eclipse.org/legal/epl-v10.html) | ||
* U.S. Government Users Restricted Rights: Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. | ||
*/ | ||
|
||
|
||
class AirPluginTool { | ||
|
||
//************************************************************************** | ||
// CLASS | ||
//************************************************************************** | ||
|
||
//************************************************************************** | ||
// INSTANCE | ||
//************************************************************************** | ||
|
||
final public def isWindows = (System.getProperty('os.name') =~ /(?i)windows/).find() | ||
|
||
def out = System.out; | ||
def err = System.err; | ||
|
||
private def inPropsFile; | ||
private def outPropsFile; | ||
|
||
def outProps; | ||
|
||
public AirPluginTool(def inFile, def outFile){ | ||
inPropsFile = inFile; | ||
outPropsFile = outFile; | ||
outProps = new Properties(); | ||
} | ||
|
||
public Properties getStepProperties() { | ||
def props = new Properties(); | ||
def inputPropsFile = this.inPropsFile; | ||
def inputPropsStream = null; | ||
try { | ||
inputPropsStream = new FileInputStream(inputPropsFile); | ||
props.load(inputPropsStream); | ||
} | ||
catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
finally { | ||
inputPropsStream.close(); | ||
} | ||
return props; | ||
} | ||
|
||
public void setOutputProperty(String name, String value) { | ||
this.outProps.setProperty(name, value); | ||
} | ||
|
||
public void setOutputProperties() { | ||
OutputStream outputPropsStream = null; | ||
try { | ||
outputPropsStream = new FileOutputStream(this.outPropsFile); | ||
outProps.store(outputPropsStream, ""); | ||
} | ||
finally { | ||
if (outputPropsStream != null) { | ||
outputPropsStream.close(); | ||
} | ||
} | ||
} | ||
|
||
public String getAuthToken() { | ||
String authToken = System.getenv("AUTH_TOKEN"); | ||
return "{\"token\" : \"" + authToken + "\"}"; | ||
} | ||
|
||
public String getAuthTokenUsername() { | ||
return "PasswordIsAuthToken"; | ||
} | ||
|
||
public void storeOutputProperties() { | ||
setOutputProperties(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,6 @@ | |
</migrate> | ||
<migrate to-version="53"> | ||
</migrate> | ||
<migrate to-version="54"> | ||
</migrate> | ||
</plugin-upgrade> |