text string | label int64 |
|---|---|
[CLS] public static void init() {
if (init_) return;
init_ = true;
URLStreamHandler h = new URLStreamHandler() {
protected URLConnection openConnection(URL _url) throws IOException {
return new Connection(_url);
}
};
FuLib.setUrlHandler("d... | 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] @Override
public T[] sort(T[] values) {
super.compareTimes = 0;
for (int i = 0; i < values.length; i++) {
for (int j = 0; j < values.length - i - 1; j++) {
super.compareTimes++;
if (values[j].compareTo(values[j + 1]) > 0) {
T temp... | 1 |
[CLS] public String getRec(String attribute, String url) {
String arr[] = new String[3];
String[] subarr = new String[6];
String mdPrefix = "";
String mdPrefixValue = "";
String iden = "";
String idenValue = "";
String s = "";
String arguments = attribute.... | 0 |
[CLS] private final String encryptPassword(String pass) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA-1");
} catch (NoSuchAlgorithmException e) {
log.log(Level.WARNING, "Error while obtaining decript algorithm", e);
throw new RuntimeExce... | 0 |
[CLS] public final void copyFile(final File fromFile, final File toFile) throws IOException {
this.createParentPathIfNeeded(toFile);
final FileChannel sourceChannel = new FileInputStream(fromFile).getChannel();
final FileChannel targetChannel = new FileOutputStream(toFile).getChannel();
... | 1 |
[CLS] public static Author GetBooksByAuthor(String authorId, int page) throws Exception {
Uri.Builder builder = new Uri.Builder();
builder.scheme("http");
builder.authority("www.goodreads.com");
builder.path("author/list/" + authorId + ".xml");
builder.appendQueryParameter("key",... | 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] public static void copyFile(File src, File dst) throws ResourceNotFoundException, ParseErrorException, Exception {
if (src.getAbsolutePath().endsWith(".vm")) {
copyVMFile(src, dst.getAbsolutePath().substring(0, dst.getAbsolutePath().lastIndexOf(".vm")));
} else {
FileInputS... | 1 |
[CLS] public static boolean copy(InputStream is, File file) {
try {
IOUtils.copy(is, new FileOutputStream(file));
return true;
} catch (Exception e) {
logger.severe(e.getMessage());
return false;
}
} [SEP] public void testAddingEntries() throws... | 1 |
[CLS] private static FTPClient getFtpClient(String ftpHost, String ftpUsername, String ftpPassword) throws SocketException, IOException {
FTPClient ftp = new FTPClient();
ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
ftp.connect(ftpHost);
int repl... | 1 |
[CLS] private void zip(String object, TupleOutput output) {
byte array[] = object.getBytes();
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream out = new GZIPOutputStream(baos);
ByteArrayInputStream in = new ByteArray... | 1 |
[CLS] private String hash(String message) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA1");
} catch (NoSuchAlgorithmException e) {
throw new AssertionError("Can't find the SHA1 algorithm in the java.security package");
}
String saltS... | 1 |
[CLS] public static boolean verifyPassword(String digest, String password) {
String alg = null;
int size = 0;
if (digest.regionMatches(true, 0, "{SHA}", 0, 5)) {
digest = digest.substring(5);
alg = "SHA-1";
size = 20;
} else if (digest.regionMatches(tr... | 0 |
[CLS] public static IBiopaxModel read(URL url) throws ReactionException, IOException {
IBiopaxModel model = null;
InputStream in = null;
try {
in = url.openStream();
model = read(in);
} catch (IOException e) {
LOGGER.error("Unable to read from URL " + ... | 0 |
[CLS] private void validateODFDoc(String url, String ver, ValidationReport commentary) throws IOException, MalformedURLException {
logger.debug("Beginning document validation ...");
synchronized (ODFValidationSession.class) {
PropertyMapBuilder builder = new PropertyMapBuilder();
... | 0 |
[CLS] public void upload(String ftpServer, String user, String password, String fileName, File source) throws MalformedURLException, IOException {
if (ftpServer != null && fileName != null && source != null) {
StringBuffer sb = new StringBuffer("ftp://");
if (user != null && password != ... | 0 |
[CLS] public static void copy(File src, File dest) throws IOException {
OutputStream stream = new FileOutputStream(dest);
FileInputStream fis = new FileInputStream(src);
byte[] buffer = new byte[16384];
while (fis.available() != 0) {
int read = fis.read(buffer);
s... | 0 |
[CLS] public static void copyFile(File source, File destination) throws IOException {
FileInputStream fis = new FileInputStream(source);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(destination);
FileChannel sourceChannel = fis.getChannel();
F... | 1 |
[CLS] public static String getMdPsw(String passwd) throws Exception {
MessageDigest md;
md = MessageDigest.getInstance("MD5");
byte[] md5hash = new byte[32];
md.update(passwd.getBytes("iso-8859-1"), 0, passwd.length());
md5hash = md.digest();
return convertToHex(md5hash);... | 1 |
[CLS] @Override
public void run() {
long timeout = 10 * 1000L;
long start = (new Date()).getTime();
try {
InputStream is = socket.getInputStream();
boolean available = false;
while (!available && !socket.isClosed()) {
... | 0 |
[CLS] private void createScript(File scriptsLocation, String relativePath, String scriptContent) {
Writer fileWriter = null;
try {
File scriptFile = new File(scriptsLocation.getAbsolutePath() + "/" + relativePath);
scriptFile.getParentFile().mkdirs();
fileWriter = new... | 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... | 1 |
[CLS] public static void zip(File srcDir, File destFile, FileFilter filter) throws IOException {
ZipOutputStream out = null;
try {
out = new ZipOutputStream(new FileOutputStream(destFile));
Collection<File> files = FileUtils.listFiles(srcDir, TrueFileFilter.TRUE, TrueFileFilter.T... | 1 |
[CLS] public static synchronized String getURLContent(URL url) {
Log log = LogUtil.getLog(FileManager.class, "getURLContent");
if (url == null) {
throw new IllegalArgumentException("url shouldn't be null!");
}
String content = (String) urlCache.get(url);
if (content !... | 0 |
[CLS] private static String encryptSHA1URL(String x) throws Exception {
java.security.MessageDigest d = null;
d = java.security.MessageDigest.getInstance("SHA-1");
d.reset();
d.update(x.getBytes());
String passwd = "";
passwd = URLEncoder.encode(new String(d.digest()), "I... | 0 |
[CLS] protected void serveStaticContent(HttpServletRequest request, HttpServletResponse response, String pathInfo) throws ServletException {
InputStream is = servletConfig.getServletContext().getResourceAsStream(pathInfo);
if (is == null) {
throw new ServletException("Static resource " + pat... | 0 |
[CLS] public void delete(DeleteInterceptorChain chain, DistinguishedName dn, LDAPConstraints constraints) throws LDAPException {
Connection con = (Connection) chain.getRequest().get(JdbcInsert.MYVD_DB_CON + this.dbInsertName);
if (con == null) {
throw new LDAPException("Operations Error", LD... | 1 |
[CLS] public static boolean writeFile(HttpServletResponse resp, File reqFile) {
boolean retVal = false;
InputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream(reqFile));
IOUtils.copy(in, resp.getOutputStream());
logger.debug("File succes... | 1 |
[CLS] public static void copyTo(java.io.File source, java.io.File dest) throws Exception {
java.io.FileInputStream inputStream = null;
java.nio.channels.FileChannel sourceChannel = null;
java.io.FileOutputStream outputStream = null;
java.nio.channels.FileChannel destChannel = null;
... | 0 |
[CLS] private String sha1(String s) {
String encrypt = s;
try {
MessageDigest sha = MessageDigest.getInstance("SHA-1");
sha.update(s.getBytes());
byte[] digest = sha.digest();
final StringBuffer buffer = new StringBuffer();
for (int i = 0; i < ... | 0 |
[CLS] public static String encrypt(String senha) {
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(senha.getBytes());
BASE64Encoder encoder = new BASE64Encoder();
return encoder.encode(digest.digest());
} catch (NoSuchAlgorithm... | 0 |
[CLS] @SuppressWarnings("static-access")
@RequestMapping(value = "/upload/upload.html", method = RequestMethod.POST)
protected void save(HttpServletRequest request, HttpServletResponse response) throws ServletException {
UPLOAD_DIRECTORY = uploadDiretory();
File diretorioUsuario = new File(UPLOA... | 1 |
[CLS] private static void copyFile(File sourceFile, File targetFile) throws FileSaveException {
try {
FileInputStream inputStream = new FileInputStream(sourceFile);
FileOutputStream outputStream = new FileOutputStream(targetFile);
FileChannel readableChannel = inputStream.get... | 1 |
[CLS] public static boolean copyFile(String sourceFileName, String destFileName) {
if (sourceFileName == null || destFileName == null) return false;
if (sourceFileName.equals(destFileName)) return false;
try {
java.io.FileInputStream in = new java.io.FileInputStream(sourceFileName);
... | 1 |
[CLS] private static String format(String check) throws NoSuchAlgorithmException, UnsupportedEncodingException {
check = check.replaceAll(" ", "");
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(check.getBytes("ISO-8859-1"));
byte[] end = md5.digest();
String di... | 0 |
[CLS] public static String move_tags(String sessionid, String absolutePathForTheMovedTags, String absolutePathForTheDestinationTag) {
String resultJsonString = "some problem existed inside the create_new_tag() function if you see this string";
try {
Log.d("current running function name:", "m... | 0 |
[CLS] public static void copyFile(File file, File destination) throws Exception {
BufferedInputStream in = null;
BufferedOutputStream out = null;
try {
in = new BufferedInputStream(new FileInputStream(file));
out = new BufferedOutputStream(new FileOutputStream(destination... | 1 |
[CLS] public static String getUploadDeleteComboBox(String fromMode, String fromFolder, String action, String object, HttpSession session) {
FTPClient ftp = new FTPClient();
CofaxToolsUser user = (CofaxToolsUser) session.getAttribute("user");
StringBuffer links = new StringBuffer();
Strin... | 0 |
[CLS] public void execute(File tsvFile, File xmlFile) {
BufferedReader reader = null;
Writer writer = null;
Boolean isFileSuccessfullyConverted = Boolean.TRUE;
TableConfiguration tableConfig = null;
try {
xmlFile.getParentFile().mkdirs();
reader = new Buff... | 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] public static void copyFile(File in, File out) throws IOException {
try {
FileReader inf = new FileReader(in);
OutputStreamWriter outf = new OutputStreamWriter(new FileOutputStream(out), "UTF-8");
int c;
while ((c = inf.read()) != -1) outf.write(c);
... | 1 |
[CLS] private boolean copyFile(File inFile, File outFile) {
BufferedReader reader = null;
BufferedWriter writer = null;
try {
reader = new BufferedReader(new FileReader(inFile));
writer = new BufferedWriter(new FileWriter(outFile));
while (reader.ready()) {
... | 1 |
[CLS] private void chooseGame(DefaultHttpClient httpclient) throws IOException, ClientProtocolException {
HttpGet httpget = new HttpGet(Constants.STRATEGICDOMINATION_URL + "/gameboard.cgi?gameid=" + 1687);
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntit... | 1 |
[CLS] public void run() {
String masterUrl = "http://localhost:" + masterJetty.getLocalPort() + "/solr/replication?command=" + ReplicationHandler.CMD_DETAILS;
URL url;
InputStream stream = null;
try {
url = new URL(masterUrl);
... | 0 |
[CLS] private void copyFile(File source, File destination) throws IOException {
FileInputStream fileInputStream = null;
FileOutputStream fileOutputStream = null;
try {
fileInputStream = new FileInputStream(source);
fileOutputStream = new FileOutputStream(destination);
... | 1 |
[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 FileInputStream(srcFile);
... | 1 |
[CLS] public void execute(File sourceFile, File destinationFile, Properties htmlCleanerConfig) {
FileReader reader = null;
Writer writer = null;
try {
reader = new FileReader(sourceFile);
logger.info("Using source file: " + trimPath(userDir, sourceFile));
if (... | 1 |
[CLS] @Test
public void testWriteAndReadSecondLevel() throws Exception {
JCFSFileServer server = new JCFSFileServer(defaultTcpPort, defaultTcpAddress, defaultUdpPort, defaultUdpAddress, dir, 0, 0);
JCFS.configureDiscovery(defaultUdpAddress, defaultUdpPort);
try {
server.start();
... | 1 |
[CLS] public static void copyFile(String source, String destination) throws IOException {
File srcDir = new File(source);
File[] files = srcDir.listFiles();
FileChannel in = null;
FileChannel out = null;
for (File file : files) {
try {
in = new FileInp... | 0 |
[CLS] @Override
public void close() throws IOException {
super.close();
byte[] signatureData = toByteArray();
ZipOutputStream zipOutputStream = new ZipOutputStream(this.targetOutputStream);
ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(this.originalZipFile));... | 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] @Override
protected IStatus runCancelableRunnable(IProgressMonitor monitor) {
IStatus returnValue = Status.OK_STATUS;
monitor.beginTask(NLS.bind(Messages.SaveFileOnDiskHandler_SavingFiles, open), informationUnitsFromExecutionEvent.size());
... | 1 |
[CLS] public static String toHash(String pw) throws Exception {
final MessageDigest md5 = MessageDigest.getInstance("md5");
md5.update(pw.getBytes("utf-8"));
final byte[] result = md5.digest();
return toHexString(result);
} [SEP] public static void loginLetitbit() throws Exception {
... | 0 |
[CLS] @Override
protected IStatus run(IProgressMonitor monitor) {
final int BUFFER_SIZE = 1024;
final int DISPLAY_BUFFER_SIZE = 8196;
File sourceFile = new File(_sourceFile);
File destFile = new File(_destFile);
if (sourceFile.exists()) {
try {
Log... | 0 |
[CLS] public void create(String oid, Serializable obj) throws PersisterException {
String key = getLock(oid);
if (key != null) {
throw new PersisterException("Object already exists: OID = " + oid);
}
Connection conn = null;
PreparedStatement ps = null;
try {
... | 0 |
[CLS] public void copyContent(long mailId1, long mailId2) throws Exception {
File file1 = new File(this.getMailDir(mailId1) + "/");
File file2 = new File(this.getMailDir(mailId2) + "/");
this.recursiveDir(file2);
if (file1.isDirectory()) {
File[] files = file1.listFiles();
... | 1 |
[CLS] public static HttpURLConnection createSoapHttpURLConnection(String url) throws MalformedURLException, IOException {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
connection.setRequestMethod("POST");
connection.addRequestProperty("Connection", "close");
... | 0 |
[CLS] public static final void copy(File src, File dest) throws IOException {
FileInputStream source = null;
FileOutputStream destination = null;
byte[] buffer;
int bytes_read;
if (!src.exists()) {
throw new IOException("Source not found: " + src);
}
i... | 1 |
[CLS] public static String MD5(String text) throws ProducteevSignatureException {
try {
MessageDigest md;
md = MessageDigest.getInstance(ALGORITHM);
byte[] md5hash;
md.update(text.getBytes("utf-8"), 0, text.length());
md5hash = md.digest();
... | 0 |
[CLS] @Override
public String fetchElectronicEdition(Publication pub) {
final String url = pub.getEe();
HttpMethod method = null;
String responseBody = "";
method = new GetMethod(url);
method.setFollowRedirects(true);
try {
if (StringUtils.isNotBlank(metho... | 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] private void zip(String object, TupleOutput output) {
byte array[] = object.getBytes();
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream out = new GZIPOutputStream(baos);
ByteArrayInputStream in = new ByteArray... | 1 |
[CLS] public static void main(String[] args) throws IOException, DataFormatException {
byte in_buf[] = new byte[20000];
if (args.length < 2) {
System.out.println("too few arguments");
System.exit(0);
}
String inputName = args[0];
InputStream in = new FileI... | 1 |
[CLS] private void sendToURL(String URL, String file) throws Exception {
URL url = new URL(URL);
InputStream is = new BufferedInputStream(new FileInputStream(file));
OutputStream os = url.openConnection().getOutputStream();
copyDocument(is, os);
is.close();
os.close();
... | 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] @HttpAction(name = "map.saveOrUpdate", method = { HttpAction.Method.post }, responseType = "text/plain")
@HttpAuthentication(method = { HttpAuthentication.Method.WSSE })
public String saveOrUpdate(FileItem file, User user, MapOriginal map) throws HttpRpcException {
File tmpFile;
GenericDAO... | 1 |
[CLS] @Override
public boolean accept(File file) {
if (file.getName().equals(".svn")) {
return false;
}
final long modify = file.lastModified();
final long time = DateUtils.toDate("2012-03-21 17:43", "yyyy-MM-dd HH:mm").getT... | 1 |
[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 insert() throws SQLException, NamingException {
Logger logger = getLogger();
if (logger.isDebugEnabled()) {
logger.debug("enter - " + getClass().getName() + ".insert()");
}
try {
if (logger.isInfoEnabled()) {
logger.info("insert(... | 0 |
[CLS] public String getString(String arg) throws Exception {
URL url = new URL(arg);
URLConnection con = url.openConnection();
con.setUseCaches(false);
con.connect();
InputStreamReader src = new InputStreamReader(con.getInputStream(), "ISO-8859-1");
StringBuffer stb = new... | 0 |
[CLS] public static String generate(String presentity, String eventPackage) {
if (presentity == null || eventPackage == null) {
return null;
}
String date = Long.toString(System.currentTimeMillis());
try {
MessageDigest md = MessageDigest.getInstance(HASH_ALGORITH... | 0 |
[CLS] public String get(String question) {
try {
System.out.println(url + question);
URL urlonlineserver = new URL(url + question);
BufferedReader in = new BufferedReader(new InputStreamReader(urlonlineserver.openStream()));
String inputLine;
String re... | 0 |
[CLS] @Override
public CasAssembly build() {
try {
prepareForBuild();
File casWorkingDirectory = casFile.getParentFile();
DefaultCasFileReadIndexToContigLookup read2contigMap = new DefaultCasFileReadIndexToContigLookup();
AbstractDefaultCasFileLookup readIdLoo... | 0 |
[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);
... | 1 |
[CLS] private void outputSignedOpenDocument(byte[] signatureData) throws IOException {
LOG.debug("output signed open document");
OutputStream signedOdfOutputStream = getSignedOpenDocumentOutputStream();
if (null == signedOdfOutputStream) {
throw new NullPointerException("signedOpenDo... | 0 |
[CLS] protected void doRestoreOrganizeRelation() throws Exception {
Connection con = null;
PreparedStatement ps = null;
ResultSet result = null;
String strDelQuery = "DELETE FROM " + Common.ORGANIZE_RELATION_TABLE;
String strSelQuery = "SELECT organize_id,organize_type_id,child_i... | 0 |
[CLS] @Override
public void executeInterruptible() {
encodingTerminated = false;
File destinationFile = null;
try {
Runtime runtime = Runtime.getRuntime();
IconAndFileListElement element;
while ((element = getNextFileElement()) ... | 1 |
[CLS] public boolean excuteBackup(String backupOrginlDrctry, String targetFileNm, String archiveFormat) throws JobExecutionException {
File targetFile = new File(targetFileNm);
File srcFile = new File(backupOrginlDrctry);
if (!srcFile.exists()) {
log.error("백업원본디렉토리[" + srcFile.getAb... | 1 |
[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;... | 1 |
[CLS] private byte[] _generate() throws NoSuchAlgorithmException {
if (host == null) {
try {
seed = InetAddress.getLocalHost().toString();
} catch (UnknownHostException e) {
seed = "localhost/127.0.0.1";
} catch (SecurityException e) {
... | 1 |
[CLS] @Override
public CasAssembly build() {
try {
prepareForBuild();
File casWorkingDirectory = casFile.getParentFile();
DefaultCasFileReadIndexToContigLookup read2contigMap = new DefaultCasFileReadIndexToContigLookup();
AbstractDefaultCasFileLookup readIdLoo... | 1 |
[CLS] public void xtest11() throws Exception {
PDFManager manager = new ITextManager();
InputStream pdf = new FileInputStream("/tmp/UML2.pdf");
InputStream page1 = manager.cut(pdf, 1, 1);
OutputStream outputStream = new FileOutputStream("/tmp/page.pdf");
IOUtils.copy(page1, outpu... | 1 |
[CLS] public static String genDigest(String info) {
MessageDigest alga;
byte[] digesta = null;
try {
alga = MessageDigest.getInstance("SHA-1");
alga.update(info.getBytes());
digesta = alga.digest();
} catch (NoSuchAlgorithmException e) {
e.... | 1 |
[CLS] public static void fileCopy(final File src, final File dest, final boolean overwrite) throws IOException {
if (!dest.exists() || (dest.exists() && overwrite)) {
final FileChannel srcChannel = new FileInputStream(src).getChannel();
final FileChannel dstChannel = new FileOutputStream... | 0 |
[CLS] public static final String computeHash(String stringToCompile) {
String retVal = null;
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.reset();
md5.update(stringToCompile.getBytes());
byte[] result = md5.digest();
StringBu... | 1 |
[CLS] public static void copyFile(File source, File destination) {
if (!source.exists()) {
return;
}
if ((destination.getParentFile() != null) && (!destination.getParentFile().exists())) {
destination.getParentFile().mkdirs();
}
try {
FileChann... | 1 |
[CLS] private void copy(File source, File target) throws IOException {
FileChannel in = (new FileInputStream(source)).getChannel();
FileChannel out = (new FileOutputStream(target)).getChannel();
in.transferTo(0, source.length(), out);
in.close();
out.close();
} [SEP] public v... | 1 |
[CLS] public void convert(String newDocumentName, URL url) throws IOException {
documentPath = createDirectoryStructure(this.destinationPath, newDocumentName);
try {
Document doc = builder.build(url.openStream());
Element elementx = doc.getRootElement();
convertElemen... | 0 |
[CLS] public void fetchKey() throws IOException {
String strurl = MessageFormat.format(keyurl, new Object[] { username, secret, login, session });
StringBuffer result = new StringBuffer();
BufferedReader reader = null;
URL url = null;
try {
url = new URL(strurl);
... | 0 |
[CLS] protected FTPClient openFTP() throws CruiseControlException {
LOG.info("Opening FTP connection to " + targetHost);
FTPClient ftp = new FTPClient();
try {
ftp.connect(targetHost, targetPort);
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
t... | 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 actionPerformed(ActionEvent e) {
if (saveForWebChooser == null) {
ExtensionFileFilter fileFilter = new ExtensionFileFilter("HTML files");
fileFilter.addExtension("html");
saveForWebChooser = new JFileChooser();
saveForWebChoos... | 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... | 0 |
[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 processExplicitSchemaAndWSDL(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
HashMap services = configContext.getAxisConfiguration().getServices();
String filePart = req.getRequestURL().toString();
String schema = filePart.substring(fileP... | 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] static InputStream getFileAsStream(Class clazz, HandlerChain chain) {
URL url = clazz.getResource(chain.file());
if (url == null) {
url = Thread.currentThread().getContextClassLoader().getResource(chain.file());
}
if (url == null) {
String tmp = clazz.getPac... | 0 |
[CLS] private static String deviceIdFromCombined_Device_ID(Context context) {
StringBuilder builder = new StringBuilder();
builder.append(deviceIdFromIMEI(context));
builder.append(deviceIdFromPseudo_Unique_Id());
builder.append(deviceIdFromAndroidId(context));
builder.append(dev... | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.