mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
C#/Java: Rename the directories containing the model generator and tests.
This commit is contained in:
32
java/ql/test/utils/modelgenerator/dataflow/p/Sources.java
Normal file
32
java/ql/test/utils/modelgenerator/dataflow/p/Sources.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package p;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.URL;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class Sources {
|
||||
|
||||
public InputStream readUrl(final URL url) throws IOException {
|
||||
return url.openConnection().getInputStream();
|
||||
}
|
||||
|
||||
public InputStream socketStream() throws IOException {
|
||||
ServerSocket socket = new ServerSocket(123);
|
||||
return socket.accept().getInputStream();
|
||||
}
|
||||
|
||||
public InputStream wrappedSocketStream() throws IOException {
|
||||
return socketStream();
|
||||
}
|
||||
|
||||
public void sourceToParameter(InputStream[] streams, List<InputStream> otherStreams) throws IOException {
|
||||
ServerSocket socket = new ServerSocket(123);
|
||||
streams[0] = socket.accept().getInputStream();
|
||||
otherStreams.add(socket.accept().getInputStream());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user