Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/generate-repository.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Scala CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2
- name: Set up JDK 12
uses: actions/setup-java@v1.3.0
with:
java-version: 12
- name: compile, run, and test
run: |
sbt run && sleep 4m &
sleep 130s
cd /tmp
git clone http://127.0.0.1:9000/benchmark42 benchmark42
cd /tmp/benchmark42
sbt compile

Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ object CloseOutputStream extends TaggedComponent {
s"""
|private void closeOutputStream(java.io.OutputStream os) {
| try {
| if(is != null) {
| is.close();
| if(os != null) {
| os.close();
| }
| } catch (Exception e) {
| System.out.println("Couldn't close OutStream");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@ object CreateFileOutputStream extends TaggedComponent{
val createFileInputStream: MethodDeclaration = {
Java(
s"""
|public java.io.FileOutputStream openFileOutputStream(String filename, HttpServletResponse response) throws java.io.IOException {
|public java.io.FileOutputStream openFileOutputStream(String fileName, HttpServletResponse response) throws java.io.IOException {
| java.io.FileOutputStream fos = null;
| try {
| fos = new FileOutputStream(fileName, false);
| response.getWriter.println("Now ready to write to file: " +
| org.owasp.esapi.ESAPI.encoder.encodeForHTML(fileName));
| return fos;
| fos = new java.io.FileOutputStream(fileName, false);
| response.getWriter().println("Now ready to write to file: " +
| org.owasp.esapi.ESAPI.encoder().encodeForHTML(fileName));
| }
| catch (Exception e) {
| System.out.println("Couldn't open FileOutputStream on file: '" + fileName + "'");
| }
|
| finally{
| return fos;
| }
|}
|""".stripMargin).methodDeclarations().head
}
Expand Down