text string | label int64 |
|---|---|
[CLS] protected List webservice(URL url, List locations, boolean followRedirect) throws GeoServiceException {
long start = System.currentTimeMillis();
int rowCount = 0, hitCount = 0;
try {
HttpURLConnection con;
try {
con = (HttpURLConnection) url.openConn... | 0 |
[CLS] protected static void copyFile(File in, File out) throws IOException {
java.io.FileWriter filewriter = null;
java.io.FileReader filereader = null;
try {
filewriter = new java.io.FileWriter(out);
filereader = new java.io.FileReader(in);
char[] buf = new c... | 1 |
[CLS] public static void copyFolderStucture(String strPath, String dstPath) throws IOException {
Constants.iLog.LogInfoLine("copying " + strPath);
File src = new File(strPath);
File dest = new File(dstPath);
if (src.isDirectory()) {
dest.mkdirs();
String list[] = ... | 0 |
[CLS] public Configuration(URL url) {
InputStream in = null;
try {
load(in = url.openStream());
} catch (Exception e) {
throw new RuntimeException("Could not load configuration from " + url, e);
} finally {
if (in != null) {
try {
... | 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] public void manageRequest(Transformer transformer) throws ServletException {
try {
this.parser.reset();
String encodedQuery = URLEncoder.encode(this.query, "ISO-8859-1");
URL url = new URL(EXIST_SERVER + "?_query=" + encodedQuery);
InputStream in = url.openS... | 0 |
[CLS] public static String SHA512(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md;
md = MessageDigest.getInstance("SHA-512");
byte[] sha1hash = new byte[40];
md.update(text.getBytes("UTF-8"), 0, text.length());
sha1hash = md.digest();... | 1 |
[CLS] private List loadPluginFromDir(File directory, boolean bSkipAlreadyLoaded, boolean loading_for_startup, boolean initialise) throws PluginException {
List loaded_pis = new ArrayList();
ClassLoader plugin_class_loader = root_class_loader;
if (!directory.isDirectory()) {
return (l... | 0 |
[CLS] public static void copyFile(File destFile, File src) throws IOException {
File destDir = destFile.getParentFile();
File tempFile = new File(destFile + "_tmp");
destDir.mkdirs();
InputStream is = new FileInputStream(src);
try {
FileOutputStream os = new FileOutpu... | 1 |
[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 copyFile(File source, File dest) throws IOException {
FileChannel in = null, out = null;
try {
in = new FileInputStream(source).getChannel();
out = new FileOutputStream(dest).getChannel();
in.transferTo(0, in.size(), out);
} catch (Fil... | 1 |
[CLS] public void prepareWorkingDirectory() throws Exception {
workingDirectory = tempDir + "/profile_" + System.nanoTime();
(new File(workingDirectory)).mkdir();
String monitorCallShellScript = "data/scripts/monitorcall.sh";
URL monitorCallShellScriptUrl = Thread.currentThread().getCont... | 1 |
[CLS] public static void compressFile(File f) throws IOException {
File target = new File(f.toString() + ".gz");
System.out.print("Compressing: " + f.getName() + ".. ");
long initialSize = f.length();
FileInputStream fis = new FileInputStream(f);
GZIPOutputStream out = new GZIPOu... | 1 |
[CLS] public static String cryptografar(String senha) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(senha.getBytes());
BigInteger hash = new BigInteger(1, md.digest());
senha = hash.toString(16);
} catch (NoSuchAlgorithmException n... | 1 |
[CLS] public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
PrintWriter out = null;
ServletOutputStream outstream = null;
try {
String action = req.getParameter("nmrshiftdbaction");
String relativepath = ServletUtils.ex... | 1 |
[CLS] protected void downloadFile(String filename, java.io.File targetFile, File partFile, ProgressMonitor monitor) throws java.io.IOException {
FileOutputStream out = null;
InputStream is = null;
try {
filename = toCanonicalFilename(filename);
URL url = new URL(root + fi... | 0 |
[CLS] protected void createValueListAnnotation(IProgressMonitor monitor, IPackageFragment pack, Map model) throws CoreException {
IProject pj = pack.getJavaProject().getProject();
QualifiedName qn = new QualifiedName(JstActivator.PLUGIN_ID, JstActivator.PACKAGE_INFO_LOCATION);
String location = ... | 0 |
[CLS] public static String executePost(String urlStr, Map paramsMap) throws IOException {
StringBuffer result = new StringBuffer();
HttpURLConnection connection = null;
URL url = new URL(urlStr);
connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);... | 0 |
[CLS] private void insertService(String table, int type) {
Connection con = null;
log.info("");
log.info("正在生成" + table + "的服务。。。。。。。");
try {
con = DODataSource.getDefaultCon();
con.setAutoCommit(false);
Statement stmt = con.createStatement();
... | 0 |
[CLS] private static String getVisitorId(String guid, String account, String userAgent, Cookie cookie) throws NoSuchAlgorithmException, UnsupportedEncodingException {
if (cookie != null && cookie.getValue() != null) {
return cookie.getValue();
}
String message;
if (!isEmpty(g... | 1 |
[CLS] public synchronized String encrypt(String plaintext) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA1");
} catch (NoSuchAlgorithmException noSuchAlgorithmException) {
noSuchAlgorithmException.printStackTrace();
}
try {
... | 1 |
[CLS] public static void copyFile(String oldPathFile, String newPathFile) {
try {
int bytesum = 0;
int byteread = 0;
File oldfile = new File(oldPathFile);
if (oldfile.exists()) {
InputStream inStream = new FileInputStream(oldPathFile);
... | 1 |
[CLS] public static String digest(String algorithm, String text) {
MessageDigest mDigest = null;
try {
mDigest = MessageDigest.getInstance(algorithm);
mDigest.update(text.getBytes(ENCODING));
} catch (NoSuchAlgorithmException nsae) {
Logger.error(Encryptor.cla... | 1 |
[CLS] private static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOEx... | 1 |
[CLS] public static void copyFromFileToFileUsingNIO(File inputFile, File outputFile) throws FileNotFoundException, IOException {
FileChannel inputChannel = new FileInputStream(inputFile).getChannel();
FileChannel outputChannel = new FileOutputStream(outputFile).getChannel();
try {
in... | 0 |
[CLS] public static JSONArray getFriends(long[] uids) throws ClientProtocolException, IOException, JSONException {
HttpClient client = new DefaultHttpClient(params);
HttpPost post = new HttpPost(FRIENDS_URI);
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add... | 0 |
[CLS] public static Object transmitObject(String servletURL, Object obj) throws IOException {
URL url;
URLConnection conn;
InputStream is;
OutputStream os;
try {
if (servletURL.startsWith("https") || servletURL.startsWith("HTTPS")) {
System.out.println... | 0 |
[CLS] private void loadMap() {
final String wordList = "vietwordlist.txt";
try {
File dataFile = new File(supportDir, wordList);
if (!dataFile.exists()) {
final ReadableByteChannel input = Channels.newChannel(ClassLoader.getSystemResourceAsStream("dict/" + dataFil... | 0 |
[CLS] public EVECalcControllerImpl(EVECalcView gui) {
this.view = gui;
properties = new Properties();
try {
InputStream resStream;
resStream = getClass().getResourceAsStream(REGION_PROPERTIES);
if (resStream == null) {
System.out.println("Loadi... | 0 |
[CLS] public synchronized String encrypt(String plaintext) throws PasswordException {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
throw new PasswordException(e.getMessage());
}
try {
... | 1 |
[CLS] private String SHA1(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md;
md = MessageDigest.getInstance("SHA-1");
byte[] sha1hash = new byte[40];
md.update(text.getBytes("iso-8859-1"), 0, text.length());
sha1hash = md.digest();
... | 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] public void appendFetch(IProgress progress, PrintWriter pw, String list, int from, int to) throws IOException {
progress.start();
try {
File storage = new File(cacheDirectory.getValue(), "mboxes");
storage.mkdirs();
File mbox = new File(storage, list + "-" + fro... | 0 |
[CLS] public void doGet(OutputStream os) throws IOException {
try {
uc = (HttpURLConnection) url.openConnection();
uc.setRequestProperty("User-Agent", USER_AGENT);
uc.setReadTimeout(READ_TIMEOUT);
logger.debug("Connect timeout=" + uc.getConnectTimeout() + " read t... | 0 |
[CLS] public static Pedido insert(Pedido objPedido) {
final Connection c = DBConnection.getConnection();
PreparedStatement pst = null;
int result;
if (c == null) {
return null;
}
try {
c.setAutoCommit(false);
String sql = "";
... | 0 |
[CLS] private static void doCopyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException {
if (destFile.exists() && destFile.isDirectory()) {
throw new IOException("Destination '" + destFile + "' exists but is a directory");
}
FileInputStream input = new FileInp... | 0 |
[CLS] private List<File> ungzipFile(File directory, File compressedFile) throws IOException {
List<File> files = new ArrayList<File>();
TarArchiveInputStream in = new TarArchiveInputStream(new GZIPInputStream(new FileInputStream(compressedFile)));
try {
TarArchiveEntry entry = in.get... | 0 |
[CLS] private static void copier(FichierElectronique source, FichierElectronique cible) throws IOException {
cible.setNom(source.getNom());
cible.setTaille(source.getTaille());
cible.setTypeMime(source.getTypeMime());
cible.setSoumetteur(source.getSoumetteur());
cible.setDateDern... | 1 |
[CLS] public static String md5(final String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] md5hash = new byte[FOUR_BYTES];
md.update(text.getBytes("iso-8859-1"), 0, text.length());
md5hash = md.digest();
... | 1 |
[CLS] private synchronized Frame addFrame(INSERT_TYPE type, File source) throws IOException {
if (source == null) throw new NullPointerException("Parameter 'source' is null");
if (!source.exists()) throw new IOException("File does not exist: " + source.getAbsolutePath());
if (source.length() <= ... | 1 |
[CLS] protected N save(String sql, Object[] args) {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
conn = JdbcUtils.getConnection();
conn.setAutoCommit(false);
pstmt = conn.prepareStatement(sql, Statement.RETURN_GENE... | 0 |
[CLS] public static void downloadFile(String htmlUrl, String dirUrl) {
try {
URL url = new URL(htmlUrl);
System.out.println("Opening connection to " + htmlUrl + "...");
URLConnection urlC = url.openConnection();
InputStream is = url.openStream();
Date ... | 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 String getLongToken(String md5Str) {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
md5.update(md5Str.getBytes(JspRunConfig.charset));
} catch (Exception e) {
e.printStackTrace();
}
StringBuffer token = toH... | 0 |
[CLS] public static void copyURLToFile(URL source, File destination) throws IOException {
InputStream input = source.openStream();
try {
FileOutputStream output = openOutputStream(destination);
try {
IOUtils.copy(input, output);
} finally {
... | 1 |
[CLS] public void testJTLM_publish100_blockSize() throws Exception {
EXISchema corpus = EXISchemaFactoryTestUtil.getEXISchema("/JTLM/schemas/TLMComposite.xsd", getClass(), m_compilerErrors);
Assert.assertEquals(0, m_compilerErrors.getTotalCount());
GrammarCache grammarCache = new GrammarCache(co... | 0 |
[CLS] public static int sendButton(String url, String id, String command) throws ClientProtocolException, IOException {
String connectString = url + "/rest/button/" + id + "/" + command;
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(connectString);
HttpRespons... | 0 |
[CLS] public void xtest2() throws Exception {
InputStream input1 = new FileInputStream("C:/Documentos/j931_01.pdf");
InputStream input2 = new FileInputStream("C:/Documentos/j931_02.pdf");
InputStream tmp = new ITextManager().merge(new InputStream[] { input1, input2 });
FileOutputStream o... | 0 |
[CLS] private void copyFile(File in, File out) throws IOException {
FileChannel sourceChannel = new FileInputStream(in).getChannel();
FileChannel destinationChannel = new FileOutputStream(out).getChannel();
sourceChannel.transferTo(0, sourceChannel.size(), destinationChannel);
sourceChan... | 1 |
[CLS] protected String encrypt(String text) throws Exception {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(text.getBytes("UTF-8"));
byte raw[] = md.digest();
String hash = (new BASE64Encoder()).encode(raw);
return hash;
} [SEP] public SWORDEntry ingestDepos... | 0 |
[CLS] private void pack() {
String szImageDir = m_szBasePath + "Images";
File fImageDir = new File(szImageDir);
fImageDir.mkdirs();
String ljIcon = System.getProperty("user.home");
ljIcon += System.getProperty("file.separator") + "MochaJournal" + System.getProperty("file.separato... | 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 String getMatches() {
StringBuilder builder = new StringBuilder("");
try {
URL url = new URL(LIVE_SCORE_URL);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine;
while ((inputLine = in.readLine())... | 0 |
[CLS] private void doDecrypt(boolean createOutput) throws IOException {
FileInputStream input = null;
FileOutputStream output = null;
File tempOutput = null;
try {
input = new FileInputStream(infile);
String cipherBaseFilename = basename(infile);
byte[... | 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 ActualTask(TEditor editor, TIGDataBase dataBase, String directoryPath) {
File myDirectory = new File(directoryPath);
int i;
Vector images = new Vector();
images = dataBase.allImageSearch();
lengthOfTask = images.size() * 2;
String dire... | 1 |
[CLS] private static void fileUpload() throws Exception {
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(postURL);
file = new File("h:\\Fantastic face.jpg");
MultipartEntity mpEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
... | 0 |
[CLS] void updateSource(Class<?> type) throws Exception {
final String path = type.getName().replaceAll("\\.", "/") + ".java";
new Thread(new Runnable() {
@Override
public void run() {
try {
URL url = Thread.currentThread().getContextClassLoad... | 1 |
[CLS] private FTPClient getFTPConnection(String strUser, String strPassword, String strServer, boolean binaryTransfer, String connectionNote, boolean passiveMode) {
FTPClient ftp = new FTPClient();
try {
int reply;
ftp.connect(strServer);
ResourcePool.LogMessage(this,... | 0 |
[CLS] public UpdaterView(SingleFrameApplication app, String[] args) {
super(app);
if (args.length != 3) {
System.out.println("Args must be passed.");
System.exit(1);
} else {
currentVersion = Double.parseDouble(args[0]);
currentDBVersion = Double.p... | 0 |
[CLS] protected Collection<BibtexEntry> getBibtexEntries(String ticket, String citations) throws IOException {
try {
URL url = new URL(URL_BIBTEX);
URLConnection conn = url.openConnection();
conn.setRequestProperty("Cookie", ticket + "; " + citations);
conn.connec... | 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] public static boolean copy(FileSystem srcFS, Path src, FileSystem dstFS, Path dst, boolean deleteSource, boolean overwrite, Configuration conf) throws IOException {
LOG.debug("[sgkim] copy - start");
dst = checkDest(src.getName(), dstFS, dst, overwrite);
if (srcFS.getFileStatus(src).isDir(... | 1 |
[CLS] public static void copyFolderStucture(String strPath, String dstPath) throws IOException {
Constants.iLog.LogInfoLine("copying " + strPath);
File src = new File(strPath);
File dest = new File(dstPath);
if (src.isDirectory()) {
dest.mkdirs();
String list[] = ... | 1 |
[CLS] public void copyFile(String source_name, String dest_name) throws IOException {
File source_file = new File(source_name);
File destination_file = new File(dest_name);
FileInputStream source = null;
FileOutputStream destination = null;
byte[] buffer;
int bytes_read;
... | 1 |
[CLS] private static String scramble(String text) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(text.getBytes("UTF-8"));
StringBuffer sb = new StringBuffer();
for (byte b : md.digest()) sb.append(Integer.toString(b & 0xFF, 16));
... | 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] @Override
public void start() {
System.err.println("start AutoplotApplet " + VERSION + " @ " + (System.currentTimeMillis() - t0) + " msec");
super.start();
model = new ApplicationModel();
model.setExceptionHandler(new ExceptionHandler() {
public void handle(Throwab... | 0 |
[CLS] public synchronized long nextValue(final Session session) {
if (sequence < seqLimit) {
return ++sequence;
} else {
final MetaDatabase db = MetaTable.DATABASE.of(table);
Connection connection = null;
ResultSet res = null;
String sql = null... | 0 |
[CLS] public static void parseString(String str, String name) {
BufferedReader reader;
String zeile = null;
boolean firstL = true;
int lambda;
float intens;
int l_b = 0;
int l_e = 0;
HashMap<Integer, Float> curve = new HashMap<Integer, Float>();
St... | 1 |
[CLS] public InputStream getResource(String resourceName) throws IOException {
if (!resourceName.startsWith("/")) {
resourceName += "/";
}
URL url = bc.getBundle().getResource(COOS_CONFIG_PATH + resourceName);
InputStream is = null;
try {
FileInputStream f... | 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] public Boolean compress(String sSourceDir, ArrayList<String> aFiles, String sDestinationFilename) {
logger.debug("compress(%s, %s, %s)", sSourceDir, aFiles, sDestinationFilename);
BufferedInputStream oOrigin = null;
FileOutputStream oDestination;
ZipOutputStream oOutput = null;
... | 0 |
[CLS] public ActualTask(TEditor editor, TIGDataBase dataBase, String directoryPath, String myImagesBehaviour) {
File myDirectory = new File(directoryPath);
String[] list = myDirectory.list();
File fileXML = new File(directoryPath + "images.xml");
SAXBuilder builder = new ... | 1 |
[CLS] private void copyFile(String inputPath, String basis, String filename) throws GLMRessourceFileException {
try {
FileChannel inChannel = new FileInputStream(new File(inputPath)).getChannel();
File target = new File(basis, filename);
FileChannel outChannel = new FileOutpu... | 1 |
[CLS] public static boolean filecopy(final File source, final File target) {
boolean out = false;
if (source.isDirectory() || !source.exists() || target.isDirectory() || source.equals(target)) return false;
try {
target.getParentFile().mkdirs();
target.createNewFile();
... | 0 |
[CLS] private static void processFile(StreamDriver driver, String sourceName) throws Exception {
String destName = sourceName + ".xml";
File dest = new File(destName);
if (dest.exists()) {
throw new IllegalArgumentException("File '" + destName + "' already exists!");
}
... | 1 |
[CLS] Bitmap downloadImage(String uri) {
try {
mGetMethod.setURI(new URI(uri));
HttpResponse resp = mClient.execute(mGetMethod);
if (resp.getStatusLine().getStatusCode() < 400) {
InputStream is = resp.getEntity().getContent();
... | 0 |
[CLS] private long getLastModified(Set resourcePaths, Map jarPaths) throws Exception {
long lastModified = 0;
Iterator paths = resourcePaths.iterator();
while (paths.hasNext()) {
String path = (String) paths.next();
URL url = context.getServletContext().getResource(path);... | 0 |
[CLS] public static String generateSHA1Digest(String text) {
try {
MessageDigest md;
md = MessageDigest.getInstance("SHA-1");
byte[] sha1hash = new byte[40];
md.update(text.getBytes("UTF-8"), 0, text.length());
sha1hash = md.digest();
retur... | 1 |
[CLS] public static void main(String[] args) {
try {
{
byte[] bytes1 = { (byte) 2, (byte) 2, (byte) 3, (byte) 0, (byte) 9 };
byte[] bytes2 = { (byte) 99, (byte) 2, (byte) 2, (byte) 3, (byte) 0, (byte) 9 };
System.out.println("Bytes 2,2,3,0,9 as Base64:... | 1 |
[CLS] public void testStorageByteArray() throws Exception {
TranslationResponseInMemory r = new TranslationResponseInMemory(2048, "UTF-8");
{
OutputStream output = r.getOutputStream();
output.write("This is an example".getBytes("UTF-8"));
output.write(" and another on... | 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 void fileUpload() throws IOException {
HttpClient httpclient = new DefaultHttpClient();
httpclient.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);
file = new File("H:\\FileServeUploader.java");
HttpPost httppost = new HttpPost(post... | 0 |
[CLS] @Test
public void testCopy() throws IOException {
final byte[] input = { 0x00, 0x01, 0x7F, 0x03, 0x40 };
final byte[] verification = input.clone();
Assert.assertNotSame("Expecting verification to be a new array.", input, verification);
final ByteArrayInputStream in = new ByteAr... | 1 |
[CLS] private void updateService(int nodeID, String interfaceIP, int serviceID, String notifyFlag) throws ServletException {
Connection connection = null;
final DBUtils d = new DBUtils(getClass());
try {
connection = Vault.getDbConnection();
d.watch(connection);
... | 1 |
[CLS] public boolean verify(String digest, String password) throws NoSuchAlgorithmException {
String alg = null;
int size = 0;
if (digest.regionMatches(true, 0, "{CRYPT}", 0, 7)) {
digest = digest.substring(7);
return UnixCrypt.matches(digest, password);
} else if... | 1 |
[CLS] public void maj(String titre, String num_version) {
int res = 2;
String content_xml = "";
try {
URL url = new URL("http://code.google.com/feeds/p/tux-team/downloads/basic");
InputStreamReader ipsr = new InputStreamReader(url.openStream());
BufferedReader... | 0 |
[CLS] private boolean copyToFile(String folder, String fileName) throws StorageException {
InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(folder + "/" + fileName);
if (in == null) {
return false;
}
FileOutputStream out = null;
try ... | 1 |
[CLS] public void process(String dir) {
String[] list = new File(dir).list();
if (list == null) return;
int n = list.length;
long[] bubblesort = new long[list.length + 1];
if (!statustext) {
IJ.log("Current Directory is: " + dir);
IJ.log(" ");
... | 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 void importCertFile(File file) throws IOException {
File kd;
File cd;
synchronized (this) {
kd = keysDir;
cd = certsDir;
}
if (!cd.isDirectory()) {
kd.mkdirs();
cd.mkdirs();
}
String newName = file.getNa... | 0 |
[CLS] public static GenericDocumentTransformer<? extends GenericDocument> getTranformer(URL url) throws IOException {
setDefaultImplementation();
if ("text/xml".equals(url.openConnection().getContentType()) || "application/xml".equals(url.openConnection().getContentType())) {
return null;
... | 0 |
[CLS] public void xtest7() throws Exception {
System.out.println("Lowagie");
FileInputStream inputStream = new FileInputStream("C:/Temp/arquivo.pdf");
PDFBoxManager manager = new PDFBoxManager();
InputStream[] images = manager.toImage(inputStream, "jpeg");
int count = 0;
... | 1 |
[CLS] @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String arg = req.getParameter("file");
if (arg == null) {
resp.sendError(404, "Missing 'file' Arg");
return;
}
int mfid = NumberUtils.... | 1 |
[CLS] void copyFile(File src, File dst) throws IOException {
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) out.write(buf, 0, len);
in.close();
out.clo... | 1 |
[CLS] public static void copyFile(File source, File destination) throws IOException {
BufferedInputStream in = new BufferedInputStream(new FileInputStream(source));
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(destination));
byte[] buffer = new byte[4096];... | 0 |
[CLS] public Vector split() {
File nextFile = new File(filename);
long fileSize = nextFile.length();
long parts = fileSize / splitSize;
Vector vec = new Vector(new Long(parts).intValue());
if (debug) {
System.out.println("File: " + nextFile.getName() + "\nfileSize: " ... | 1 |
[CLS] public void execute() {
checkInput();
try {
client = new FTPClient();
log("Connecting to " + ftpServer, Project.MSG_INFO);
client.connect(ftpServer, ftpPort);
checkFtpCode(client, "FTP server refused connection:");
log("Connected", Projec... | 0 |
[CLS] private void appendArchive(File instClass) throws IOException {
FileOutputStream out = new FileOutputStream(instClass.getName(), true);
FileInputStream zipStream = new FileInputStream("install.jar");
byte[] buf = new byte[2048];
int read = zipStream.read(buf);
while (read >... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.