text string | label int64 |
|---|---|
[CLS] public void copy(File s, File t) throws IOException {
FileChannel in = (new FileInputStream(s)).getChannel();
FileChannel out = (new FileOutputStream(t)).getChannel();
in.transferTo(0, s.length(), out);
in.close();
out.close();
} [SEP] public voi... | 1 |
[CLS] private String hashString(String key) {
MessageDigest digest;
try {
digest = java.security.MessageDigest.getInstance("MD5");
digest.update(key.getBytes());
byte[] hash = digest.digest();
BigInteger bi = new BigInteger(1, hash);
return Str... | 0 |
[CLS] public String setContent(URL url, String inputdata) {
String content = "";
try {
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.connect();
... | 0 |
[CLS] public static int zipFile(File file_input, File dir_output) {
File zip_output = new File(dir_output, file_input.getName() + ".zip");
ZipOutputStream zip_out_stream;
try {
FileOutputStream out = new FileOutputStream(zip_output);
zip_out_stream = new ZipOutputStream(n... | 1 |
[CLS] public static void main(String[] args) {
FTPClient client = new FTPClient();
try {
client.connect("192.168.1.10");
boolean login = client.login("a", "123456");
if (login) {
System.out.println("Dang nhap thanh cong...");
boolean lo... | 0 |
[CLS] @Override
public int updateStatement(String sql) {
Statement statement = null;
try {
statement = getConnection().createStatement();
return statement.executeUpdate(sql);
} catch (SQLException e) {
try {
getConnection().rollback();
... | 0 |
[CLS] private static void readAndRewrite(File inFile, File outFile) throws IOException {
ImageInputStream iis = ImageIO.createImageInputStream(new BufferedInputStream(new FileInputStream(inFile)));
DcmParser dcmParser = DcmParserFactory.getInstance().newDcmParser(iis);
Dataset ds = DcmObjectFact... | 1 |
[CLS] public void patchFile(final File classFile) {
if (!classFile.exists()) {
myErrors.add(new FormErrorInfo(null, "Class to bind does not exist: " + myRootContainer.getClassToBind()));
return;
}
FileInputStream fis;
try {
byte[] patchedData;
... | 0 |
[CLS] @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String pathInfo = req.getPathInfo();
String pluginPathInfo = pathInfo.substring(prefix.length());
String gwtPathInfo = pluginPathInfo.substring(pluginKey.length() + 1... | 0 |
[CLS] public void doAction(HttpServletRequest request, HttpServletResponse response) throws Exception {
String attachmentName = request.getParameter("attachment");
String virtualWiki = getVirtualWiki(request);
File uploadPath = getEnvironment().uploadPath(virtualWiki, attachmentName);
re... | 0 |
[CLS] public static void doVersionCheck(View view) {
view.showWaitCursor();
try {
URL url = new URL(jEdit.getProperty("version-check.url"));
InputStream in = url.openStream();
BufferedReader bin = new BufferedReader(new InputStreamReader(in));
String line;... | 0 |
[CLS] public URLConnection getResourceConnection(String name) throws ResourceException {
if (context == null) throw new ResourceException("There is no ServletContext to get the requested resource");
URL url = null;
try {
url = context.getResource("/WEB-INF/scriptags/" + name);
... | 0 |
[CLS] public static void main(String[] args) throws Exception {
FileChannel fc = new FileOutputStream("data.txt").getChannel();
fc.write(ByteBuffer.wrap("Some text ".getBytes()));
fc.close();
fc = new RandomAccessFile("data.txt", "rw").getChannel();
fc.position(fc.size());
... | 1 |
[CLS] private void parseExternalCss(Document d) throws XPathExpressionException, IOException {
InputStream is = null;
try {
XPath xp = xpf.newXPath();
XPathExpression xpe = xp.compile("//link[@type='text/css']/@href");
NodeList nl = (NodeList) xpe.evaluate(d, XPathCon... | 1 |
[CLS] public static void kopirujSoubor(File vstup, File vystup) throws IOException {
FileChannel sourceChannel = new FileInputStream(vstup).getChannel();
FileChannel destinationChannel = new FileOutputStream(vystup).getChannel();
sourceChannel.transferTo(0, sourceChannel.size(), destinationChann... | 1 |
[CLS] public void execute() throws BuildException {
Project proj = getProject();
if (templateFile == null) throw new BuildException("Template file not set");
if (targetFile == null) throw new BuildException("Target file not set");
try {
File template = new File(templateFile);... | 0 |
[CLS] public static String md5(String input) {
String res = "";
try {
MessageDigest algorithm = MessageDigest.getInstance("MD5");
algorithm.reset();
algorithm.update(input.getBytes());
byte[] md5 = algorithm.digest();
String tmp = "";
... | 1 |
[CLS] public static boolean encodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 1 |
[CLS] public static boolean encodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 1 |
[CLS] private int getRootNodeId(DataSource dataSource) throws SQLException {
Connection conn = null;
Statement st = null;
ResultSet rs = null;
String query = null;
try {
conn = dataSource.getConnection();
st = conn.createStatement();
query = "s... | 0 |
[CLS] public static String send(String ipStr, int port, String password, String command, InetAddress localhost, int localPort) throws SocketTimeoutException, BadRcon, ResponseEmpty {
StringBuffer response = new StringBuffer();
try {
rconSocket = new Socket();
rconSocket.bind(new ... | 0 |
[CLS] public boolean addTextGroup(String key, URL url) {
if (_textGroups.contains(key)) return false;
String s;
Hashtable tg = new Hashtable();
String sGroupKey = "default";
String sGroup[];
Vector vGroup = new Vector();
int cntr;
try {
Buffere... | 1 |
[CLS] @org.junit.Test
public void simpleRead() throws Exception {
final InputStream istream = StatsInputStreamTest.class.getResourceAsStream("/testFile.txt");
final StatsInputStream ris = new StatsInputStream(istream);
assertEquals("read size", 0, ris.getSize());
IOUtils.copy(ris, ne... | 1 |
[CLS] private static void copyFile(String fromFile, String toFile) throws Exception {
FileInputStream from = null;
FileOutputStream to = null;
try {
from = new FileInputStream(fromFile);
to = new FileOutputStream(toFile);
byte[] buffer = new byte[4096];
... | 1 |
[CLS] public String login(HttpSession callingSession, String username, String password) {
String token = null;
String customer = null;
int timeoutInSeconds = 0;
HashSet<Integer> tileProviderIds = new HashSet<Integer>();
boolean bLoginOk = false;
String dbPassword = (Strin... | 0 |
[CLS] public File createReadmeFile(File dir, MavenProject mavenProject) throws IOException {
InputStream is = getClass().getResourceAsStream("README.template");
StringWriter sw = new StringWriter();
IOUtils.copy(is, sw);
String content = sw.getBuffer().toString();
content = Strin... | 1 |
[CLS] private void chopFileDisk() throws IOException {
File tempFile = new File("" + logFile + ".tmp");
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
long startCopyPos;
byte readBuffer[] = new byte[2048];
int readCount;
long totalBytesRead = 0;
... | 1 |
[CLS] protected URLConnection openURLConnection() throws IOException {
final String locator = getMediaLocator();
if (locator == null) {
return null;
}
final URL url;
try {
url = new URL(locator);
} catch (MalformedURLException ex) {
thr... | 0 |
[CLS] @Test
public void testCopy_inputStreamToOutputStream_IO84() throws Exception {
long size = (long) Integer.MAX_VALUE + (long) 1;
InputStream in = new NullInputStreamTest(size);
OutputStream out = new OutputStream() {
@Override
public void write(int b) throws IOE... | 1 |
[CLS] public String getValidationKey(String transactionId, double transactionAmount) {
try {
java.security.MessageDigest d = java.security.MessageDigest.getInstance("MD5");
d.reset();
String value = this.getPostingKey() + transactionId + transactionAmount;
d.updat... | 1 |
[CLS] public void writeFile(OutputStream outputStream) throws IOException {
InputStream inputStream = null;
if (file != null) {
try {
inputStream = new FileInputStream(file);
IOUtils.copy(inputStream, outputStream);
} finall... | 0 |
[CLS] private void updateSystem() throws IOException {
String stringUrl="http://code.google.com/p/senai-pe-cronos/downloads/list";
try {
url = new URL(stringUrl);
} catch (MalformedURLException ex) {
ex.printStackTrace();
}
InputStream is = url.openStrea... | 1 |
[CLS] public static void copy(File in, File out) throws IOException {
FileChannel ic = new FileInputStream(in).getChannel();
FileChannel oc = new FileOutputStream(out).getChannel();
ic.transferTo(0, ic.size(), oc);
ic.close();
oc.close();
} [SEP] private static <T> Collection... | 0 |
[CLS] private static boolean unzipWithWarning(File source, File targetDirectory, OverwriteValue policy) {
try {
if (!source.exists()) return false;
ZipInputStream input = new ZipInputStream(new FileInputStream(source));
ZipEntry zipEntry = null;
byte[] buffer = ne... | 1 |
[CLS] private void getRandomGUID(boolean secure) {
MessageDigest md5 = null;
StringBuffer sbValueBeforeMD5 = new StringBuffer();
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
System.out.println("Error: " + e);
}
... | 1 |
[CLS] public static void copyFile(File source, File dest) throws IOException {
if (source.equals(dest)) return;
FileChannel srcChannel = new FileInputStream(source).getChannel();
FileChannel dstChannel = new FileOutputStream(dest).getChannel();
dstChannel.transferFrom(srcChannel, 0, srcC... | 1 |
[CLS] @Override
public void createCopy(File sourceFile, File destinnationFile) throws IOException {
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChannel();
destination = new FileOutputStream(destinnationF... | 1 |
[CLS] public static boolean encodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 0 |
[CLS] private void displayDiffResults() throws IOException {
File outFile = File.createTempFile("diff", ".htm");
outFile.deleteOnExit();
FileOutputStream outStream = new FileOutputStream(outFile);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outStream));
out.wri... | 1 |
[CLS] public static String getMD5Hash(String data) {
MessageDigest digest;
try {
digest = java.security.MessageDigest.getInstance("MD5");
digest.update(data.getBytes());
byte[] hash = digest.digest();
StringBuffer hexString = new StringBuffer();
... | 0 |
[CLS] private void processAlignmentsFromAlignmentSource(String name, Alignment reference, String alignmentSource) throws AlignmentParserException, IllegalArgumentException, KADMOSCMDException, IOException {
if (alignmentSource == null) throw new IllegalArgumentException("alignmentSource is null");
URL u... | 1 |
[CLS] public static boolean decodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.B64InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Ba... | 0 |
[CLS] private static void readAndRewrite(File inFile, File outFile) throws IOException {
ImageInputStream iis = ImageIO.createImageInputStream(new BufferedInputStream(new FileInputStream(inFile)));
DcmParser dcmParser = DcmParserFactory.getInstance().newDcmParser(iis);
Dataset ds = DcmObjectFact... | 1 |
[CLS] static void copy(String src, String dest) throws IOException {
File ifp = new File(src);
File ofp = new File(dest);
if (ifp.exists() == false) {
throw new IOException("file '" + src + "' does not exist");
}
FileInputStream fis = new FileInputStream(ifp);
... | 0 |
[CLS] private void gzip(FileHolder fileHolder) {
byte[] buffer = new byte[BUFFER_SIZE];
int bytes_read;
if (fileHolder.selectedFileList.size() == 0) {
return;
}
File destFile = new File(fileHolder.destFiles[0]);
try {
OutputStream outStream = new F... | 0 |
[CLS] private boolean copyOldSetupClass(File lastVerPath, File destPath) throws java.io.FileNotFoundException, IOException {
byte[] buf;
File oldClass = new File(lastVerPath.getAbsolutePath() + File.separator + installClassName_ + ".class");
if (oldClass.exists()) {
FileOutputStream ... | 0 |
[CLS] public static String cryptSha(String target) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(target.getBytes("UTF-16"));
BigInteger res = new BigInteger(1, md.digest(key.getBytes()));
return res.toString... | 0 |
[CLS] public void bubblesort(String filenames[]) {
for (int i = filenames.length - 1; i > 0; i--) {
for (int j = 0; j < i; j++) {
String temp;
if (filenames[j].compareTo(filenames[j + 1]) > 0) {
temp = filenames[j];
filenames[j]... | 0 |
[CLS] public static String getAnalysisServletOutput(String inputXml) {
java.io.BufferedWriter bWriter = null;
URLConnection connection = null;
String resultString = "";
bWriter = null;
connection = null;
String target = ServletConstant.ANALYSIS_SERVLET;
String mes... | 0 |
[CLS] public void convert(File src, File dest) throws IOException {
InputStream in = new BufferedInputStream(new FileInputStream(src));
DcmParser p = pfact.newDcmParser(in);
Dataset ds = fact.newDataset();
p.setDcmHandler(ds.getDcmHandler());
try {
FileFormat format =... | 1 |
[CLS] private void getRandomGUID(boolean secure) {
MessageDigest md5 = null;
StringBuffer sbValueBeforeMD5 = new StringBuffer();
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
System.out.println("Error: " + e);
}
... | 0 |
[CLS] public static String contents(URL url) throws IOException {
InputStream is = url.openStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
while (true) {
int len = is.read(buf);
if (len < 0) {
break;... | 0 |
[CLS] public static boolean decodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 1 |
[CLS] public static Test suite() throws Exception {
java.net.URL url = ClassLoader.getSystemResource("host0.jndi.properties");
java.util.Properties host0JndiProps = new java.util.Properties();
host0JndiProps.load(url.openStream());
java.util.Properties systemProps = System.getProperties(... | 0 |
[CLS] public void load(String filename) throws VisbardException {
String defaultFilename = VisbardMain.getSettingsDir() + File.separator + DEFAULT_SETTINGS_FILE;
File defaultFile = new File(defaultFilename);
InputStream settingsInStreamFromFile = null;
try {
sLogger.info("Loa... | 1 |
[CLS] private static void compressZip(String source, String dest) throws Exception {
File baseFolder = new File(source);
if (baseFolder.exists()) {
if (baseFolder.isDirectory()) {
List<File> fileList = getSubFiles(new File(source));
ZipOutputStream zos = new Z... | 1 |
[CLS] public static void zip(String destination, String folder) {
File fdir = new File(folder);
File[] files = fdir.listFiles();
PrintWriter stdout = new PrintWriter(System.out, true);
int read = 0;
FileInputStream in;
byte[] data = new byte[1024];
try {
... | 0 |
[CLS] public static void copyFile(final File sourceFile, final File destFile) throws IOException {
if (!destFile.exists()) destFile.createNewFile();
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChannel();
... | 1 |
[CLS] public static boolean decodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 1 |
[CLS] public void check() {
statusBar.setStatusText(Labels.getLabel("state.retrievingVersion"));
Runnable checkVersionCode = new Runnable() {
public void run() {
BufferedReader reader = null;
String message = null;
int ... | 0 |
[CLS] public GGMunicipalities getListMunicipalities() throws IllegalStateException, GGException, Exception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("method", "gg.photos.geo.getListMunicipality"));
qparams.add(new BasicNameValuePair("key",... | 0 |
[CLS] private static void copy(File source, File dest) throws FileNotFoundException, IOException {
FileInputStream input = new FileInputStream(source);
FileOutputStream output = new FileOutputStream(dest);
System.out.println("Copying " + source + " to " + dest);
IOUtils.copy(input, outpu... | 0 |
[CLS] public static boolean makeBackup(File dir, String sourcedir, String destinationdir, String destinationDirEnding, boolean autoInitialized) {
boolean success = false;
String[] files;
files = dir.list();
File checkdir = new File(destinationdir + System.getProperty("file.separator") + ... | 0 |
[CLS] private void getRandomGUID(boolean secure) {
MessageDigest md5 = null;
StringBuffer sbValueBeforeMD5 = new StringBuffer();
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
System.out.println("Error: " + e);
}
... | 0 |
[CLS] public int[] sort() {
boolean t = true;
int temp = 0;
int[] mas = new int[N];
Random rand = new Random();
for (int i = 0; i < N; i++) {
mas[i] = rand.nextInt(10) + 1;
}
while (t) {
t = false;
for (int i = 0; i < mas.length... | 1 |
[CLS] private void displayDiffResults() throws IOException {
File outFile = File.createTempFile("diff", ".htm");
outFile.deleteOnExit();
FileOutputStream outStream = new FileOutputStream(outFile);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outStream));
out.wri... | 0 |
[CLS] public int deleteFile(Integer[] fileID) throws SQLException {
PreparedStatement pstmt = null;
ResultSet rs = null;
Connection conn = null;
int nbrow = 0;
try {
DataSource ds = getDataSource(DEFAULT_DATASOURCE);
conn = ds.getConnection();
... | 0 |
[CLS] private void createNodes() {
try {
URL url = this.getClass().getResource(this.nodeFileName);
InputStreamReader inReader = new InputStreamReader(url.openStream());
BufferedReader inNodes = new BufferedReader(inReader);
// BufferedReader inNodes = new Buffere... | 1 |
[CLS] @Override
protected int run(CmdLineParser parser) {
final List<String> args = parser.getRemainingArgs();
if (args.isEmpty()) {
System.err.println("summarysort :: WORKDIR not given.");
return 3;
}
if (args.size() == 1) {
System.err.println("su... | 1 |
[CLS] public String doGet() throws MalformedURLException, IOException {
uc = (HttpURLConnection) url.openConnection();
BufferedInputStream buffer = new BufferedInputStream(uc.getInputStream());
ByteArrayOutputStream bos = new ByteArrayOutputStream();
int c;
while ((c = buffer.rea... | 0 |
[CLS] private String doUploadFile(String sessionId, File file, String originalFileName) throws UnsupportedEncodingException, IOException {
log(INFO, sessionId);
log(INFO, file.getPath());
DefaultHttpClient httpclient = new DefaultHttpClient();
UploadFileRequest request = new UploadFileRe... | 0 |
[CLS] public MusicBrainzXMLParser(URL url) throws DocumentException, IOException {
URLConnection urlConnection = url.openConnection();
InputStream httpStream = urlConnection.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(httpStream, "ISO-8859-1"));
SAXRead... | 0 |
[CLS] public static void httpOnLoad(String fileName, String urlpath) throws Exception {
URL url = new URL(urlpath);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.connect();
int responseCode = conn.getResponseCode();
... | 0 |
[CLS] protected void setUp() throws Exception {
testOutputDirectory = new File(getClass().getResource("/").getPath());
zipFile = new File(this.testOutputDirectory, "/plugin.zip");
zipOutputDirectory = new File(this.testOutputDirectory, "zip");
zipOutputDirectory.mkdir();
logger.f... | 1 |
[CLS] private void setManagedContent(Entry entry, Datastream vds) throws StreamIOException {
if (m_transContext == DOTranslationUtility.SERIALIZE_EXPORT_ARCHIVE && !m_format.equals(ATOM_ZIP1_1)) {
String mimeType = vds.DSMIME;
if (MimeTypeHelper.isText(mimeType) || MimeTypeHelper.isXml(m... | 0 |
[CLS] public void update(Channel channel) throws Exception {
DBOperation dbo = null;
Connection connection = null;
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
String exp = channel.getExtendParent();
String path = channel.getPath();
try ... | 0 |
[CLS] public static void main(String[] args) {
try {
boolean readExp = Utils.getFlag('l', args);
final boolean writeExp = Utils.getFlag('s', args);
final String expFile = Utils.getOption('f', args);
if ((readExp || writeExp) && (expFile.length() == 0)) {
... | 1 |
[CLS] public static void adminUpdate(int i_id, double cost, String image, String thumbnail) {
Connection con = null;
try {
tmpAdmin++;
String name = "$tmp_admin" + tmpAdmin;
con = getConnection();
PreparedStatement related1 = con.prepareStatement("CREATE T... | 0 |
[CLS] private ParserFileReader createParserFileReader(final FromNetRecord record) throws IOException {
final String strUrl = record.getStrUrl();
ParserFileReader parserFileReader;
try {
parserFileReader = parserFileReaderFactory.create(strUrl);
} catch (Exception exception) {... | 1 |
[CLS] public static boolean encodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 0 |
[CLS] public void compressImage(InputStream input, OutputStream output, DjatokaEncodeParam params) throws DjatokaException {
if (params == null) params = new DjatokaEncodeParam();
File inputFile = null;
try {
inputFile = File.createTempFile("tmp", ".tif");
IOUtils.copyStr... | 1 |
[CLS] public void reset(String componentName, int currentPilot) {
try {
PreparedStatement psta = jdbc.prepareStatement("DELETE FROM component_prop " + "WHERE pilot_id = ? " + "AND component_name = ?");
psta.setInt(1, currentPilot);
psta.setString(2, componentName);
... | 1 |
[CLS] public static void copyFile(String fileName, String dstPath) throws IOException {
FileChannel sourceChannel = new FileInputStream(fileName).getChannel();
FileChannel destinationChannel = new FileOutputStream(dstPath).getChannel();
sourceChannel.transferTo(0, sourceChannel.size(), destinati... | 1 |
[CLS] public void testManageSources() throws Exception {
this.getTestTool().manageSources(this.getTestSourcesDirectory());
this.getTestTool().manageSources(this.getTestTool().getModules().getModule("Module"), this.getTestSourcesDirectory());
final File implementationDirectory = this.getTestSourc... | 1 |
[CLS] public static String calculateSHA1(String data, String key) throws NoSuchAlgorithmException, UnsupportedEncodingException {
data += key;
MessageDigest md;
md = MessageDigest.getInstance("SHA-1");
byte[] sha1hash = new byte[40];
md.update(data.getBytes("iso-8859-1"), 0, data... | 1 |
[CLS] static Object read(String path, String encoding, boolean return_string) throws IOException {
InputStream in;
if (path.startsWith("classpath:")) {
path = path.substring("classpath:".length());
URL url = Estimate.class.getClassLoader().getResource(path);
if (url =... | 0 |
[CLS] @Override
public void aggregate() {
Connection connection = null;
PreparedStatement prestm = null;
try {
if (logger.isInfoEnabled()) logger.info("aggregate table <" + origin + "> start...");
Class.forName(driver);
connection = DriverManager.getConnec... | 0 |
[CLS] protected void handleHttp(String path, IProgressMonitor monitor, SchemaGeneratorContext ctx) throws CoreException, DuplicateFileException {
InputStream is = null;
try {
URL url = new URL(path);
is = url.openStream();
IFolder folder = getXsdFolder();
... | 0 |
[CLS] @Test
public void testCopy_readerToOutputStream_nullOut() throws Exception {
InputStream in = new ByteArrayInputStream(inData);
in = new YellOnCloseInputStreamTest(in);
Reader reader = new InputStreamReader(in, "US-ASCII");
try {
IOUtils.copy(reader, (OutputStream) ... | 1 |
[CLS] private static void readAndRewrite(File inFile, File outFile) throws IOException {
ImageInputStream iis = ImageIO.createImageInputStream(new BufferedInputStream(new FileInputStream(inFile)));
DcmParser dcmParser = DcmParserFactory.getInstance().newDcmParser(iis);
Dataset ds = DcmObjectFact... | 1 |
[CLS] public static boolean encodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 0 |
[CLS] public static boolean encodeFileToFile(final String infile, final String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(inf... | 1 |
[CLS] private static File copyFileTo(File file, File directory) throws IOException {
File newFile = new File(directory, file.getName());
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream(file);
fos = new FileOutputStream(newF... | 1 |
[CLS] @Override
public void exec() {
if (fileURI == null) return;
InputStream is = null;
try {
if (fileURI.toLowerCase().startsWith("dbgp://")) {
String uri = fileURI.substring(7);
if (uri.toLowerCase().startsWith("file/")) {
ur... | 0 |
[CLS] public void transport(File file) throws TransportException {
if (file.exists()) {
if (file.isDirectory()) {
File[] files = file.listFiles();
for (int i = 0; i < files.length; i++) {
transport(file);
}
} else if (fi... | 1 |
[CLS] public synchronized String encrypt(String password) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md = null;
md = MessageDigest.getInstance("SHA-256");
md.update(password.getBytes("UTF-8"));
byte raw[] = md.digest();
String hash = (new BASE64... | 1 |
[CLS] private void fileCopy(final File src, final File dest) throws IOException {
final FileChannel srcChannel = new FileInputStream(src).getChannel();
final FileChannel dstChannel = new FileOutputStream(dest).getChannel();
dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
srcCh... | 1 |
[CLS] public FileInputStream execute() {
FacesContext faces = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) faces.getExternalContext().getResponse();
String pdfPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath("/pdf");
try... | 0 |
[CLS] protected static boolean checkVersion(String address) {
Scanner scanner = null;
try {
URL url = new URL(address);
InputStream iS = url.openStream();
scanner = new Scanner(iS);
if (scanner == null && DEBUG) System.out.println("SCANNER NULL");
... | 1 |
[CLS] private Map<String, DomAttr> getAttributesFor(final BaseFrame frame) throws IOException {
final Map<String, DomAttr> map = createAttributesCopyWithClonedAttribute(frame, "src");
final DomAttr srcAttr = map.get("src");
if (srcAttr == null) {
return map;
}
final P... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.