text string | label int64 |
|---|---|
[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 void run() {
if (getCommand() == null) throw new IllegalArgumentException("Given command is null!");
if (getSocketProvider() == null) throw new IllegalArgumentException("Given connection is not open!");
if (getCommand() instanceof ListCommand) {
try {
set... | 0 |
[CLS] protected void migrateOnDemand() {
try {
if (fso.fileExists(prefix + ".fat") && !fso.fileExists(prefix + EXTENSIONS[UBM_FILE])) {
RandomAccessFile ubm, meta, ctr, rbm;
InputStream inputStream;
OutputStream outputStream;
fso.rename... | 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] private String hashSong(Song s) {
if (s == null) return null;
try {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
digest.update(s.getTitle().getBytes());
digest.update(s.getAllLyrics().getBytes());
String hash = Base64.encodeBytes(dige... | 1 |
[CLS] public static void addIntegrityEnforcements(Session session) throws HibernateException {
Transaction tx = null;
try {
tx = session.beginTransaction();
Statement st = session.connection().createStatement();
st.executeUpdate("DROP TABLE hresperformsrole;" + "CREAT... | 0 |
[CLS] public void sendContent(OutputStream out, Range range, Map map, String string) throws IOException, NotAuthorizedException, BadRequestException {
System.out.println("sendContent " + file);
RFileInputStream in = new RFileInputStream(file);
try {
IOUtils.copyLarge(in, out);
... | 1 |
[CLS] public static String URLtoString(URL url) throws IOException {
String xml = null;
if (url != null) {
URLConnection con = url.openConnection();
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("User-agent", "Mozi... | 0 |
[CLS] protected List<String[]> execute(String queryString, String sVar1, String sVar2, String filter) throws Exception {
String query = URLEncoder.encode(queryString, "UTF-8");
String urlString = "http://sparql.bibleontology.com/sparql.jsp?sparql=" + query + "&type1=xml";
URL url;
Buffer... | 0 |
[CLS] protected static final void copyFile(String from, String to) throws SeleniumException {
try {
java.io.File fileFrom = new File(from);
java.io.File fileTo = new File(to);
FileReader in = new FileReader(fileFrom);
FileWriter out = new FileWriter(fileTo);
... | 1 |
[CLS] public static String md5(String word) {
MessageDigest alg = null;
try {
alg = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException ex) {
Logger.getLogger(ServletUtils.class.getName()).log(Level.SEVERE, null, ex);
}
alg.reset();
... | 0 |
[CLS] private String getAuthCookie(boolean invalidate) {
if (resources.getBoolean(R.bool.dev)) {
return "dev_appserver_login=get_view@localhost.devel:false:18580476422013912411";
} else {
try {
Account[] accounts = accountsManager.getAccountsByType("com.google");
... | 0 |
[CLS] public String storeUploadedZip(byte[] zip, String name) {
List filesToStore = new ArrayList();
int i = 0;
ZipInputStream zipIs = new ZipInputStream(new ByteArrayInputStream(zip));
ZipEntry zipEntry = zipIs.getNextEntry();
while (zipEntry != null) {
if (zipEntry.... | 1 |
[CLS] private void recvMessage(String from, String to) throws Exception {
ConnectionFactoryImpl factory = new ConnectionFactoryImpl();
Receiver receiver = null;
ProviderConnection connection = factory.createConnection(from, to);
Connection conn = DBUtil.getConnection();
PreparedS... | 0 |
[CLS] private byte[] getCharImage(long chrId) {
byte[] imgData = null;
try {
URL url = new URL("http://img.eve.is/serv.asp?s=256&c=" + chrId);
URLConnection conn = url.openConnection();
InputStream is = conn.getInputStream();
ByteArrayOutputStream os = new... | 0 |
[CLS] public static String crypt(String senha) {
String md5 = null;
MessageDigest md;
try {
md = MessageDigest.getInstance(CRYPT_ALGORITHM);
md.update(senha.getBytes());
Hex hex = new Hex();
md5 = new String(hex.encode(md.digest()));
} catc... | 1 |
[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] public HashCash(String cash) throws NoSuchAlgorithmException {
myToken = cash;
String[] parts = cash.split(":");
myVersion = Integer.parseInt(parts[0]);
if (myVersion < 0 || myVersion > 1) throw new IllegalArgumentException("Only supported versions are 0 and 1");
if ((myVer... | 1 |
[CLS] private ImageReader findImageReader(URL url) {
ImageInputStream input = null;
try {
input = ImageIO.createImageInputStream(url.openStream());
} catch (IOException e) {
logger.log(Level.WARNING, "zly adres URL obrazka " + url, e);
}
ImageReader reader... | 0 |
[CLS] public synchronized String decrypt(String plaintext) throws Exception {
MessageDigest md = null;
String strhash = new String((new BASE64Decoder()).decodeBuffer(plaintext));
System.out.println("strhash1122 " + strhash);
try {
md = MessageDigest.getInstance("MD5");
... | 1 |
[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... | 1 |
[CLS] @Test
public void testCopy_readerToOutputStream_Encoding_nullOut() throws Exception {
InputStream in = new ByteArrayInputStream(inData);
in = new YellOnCloseInputStreamTest(in);
Reader reader = new InputStreamReader(in, "US-ASCII");
try {
IOUtils.copy(reader, (Outpu... | 1 |
[CLS] public static boolean copyFile(String source, String destination, boolean replace) {
File sourceFile = new File(source);
File destinationFile = new File(destination);
if (sourceFile.isDirectory() || destinationFile.isDirectory()) return false;
if (destinationFile.isFile() && !repla... | 0 |
[CLS] protected void setupService(MessageContext msgContext) throws Exception {
String realpath = msgContext.getStrProp(Constants.MC_REALPATH);
String extension = (String) getOption(OPTION_JWS_FILE_EXTENSION);
if (extension == null) extension = DEFAULT_JWS_FILE_EXTENSION;
if ((realpath !... | 1 |
[CLS] private String xifraPassword() throws Exception {
String password2 = instance.getUsuaris().getPassword2();
MessageDigest m = MessageDigest.getInstance("MD5");
m.update(password2.getBytes(), 0, password2.length());
password2 = new BigInteger(1, m.digest()).toString(16);
retu... | 0 |
[CLS] public static boolean copyFile(File from, File to, byte[] buf) {
if (buf == null) buf = new byte[BUFFER_SIZE];
FileInputStream from_s = null;
FileOutputStream to_s = null;
try {
from_s = new FileInputStream(from);
to_s = new FileOutputStream(to);
... | 0 |
[CLS] public MemoryTextBody(InputStream is, String mimeCharset) throws IOException {
this.mimeCharset = mimeCharset;
TempPath tempPath = TempStorage.getInstance().getRootTempPath();
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtils.copy(is, out);
out.close();
... | 1 |
[CLS] static void copyFile(File file, File destDir) {
File destFile = new File(destDir, file.getName());
if (destFile.exists() && (!destFile.canWrite())) {
throw new SyncException("Cannot overwrite " + destFile + " because " + "it is read-only");
}
try {
FileInput... | 1 |
[CLS] public String getPolicy(String messageBufferName) throws AppFabricException {
String responseString = null;
MessageBufferUtil msgBufferUtilObj = new MessageBufferUtil(solutionName, TokenConstants.getSimpleAuthAuthenticationType());
String requestUri = msgBufferUtilObj.getRequestUri();
... | 0 |
[CLS] private String writeInputStreamToString(InputStream stream) {
StringWriter stringWriter = new StringWriter();
try {
IOUtils.copy(stream, stringWriter);
} catch (IOException e) {
e.printStackTrace();
}
String namespaces = stringWriter.toString().trim(... | 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... | 0 |
[CLS] private <T> Collection<T> loadProviders(final Class<T> providerClass) throws ModelException {
try {
final String providerNamePrefix = providerClass.getName() + ".";
final Map<String, T> providers = new TreeMap<String, T>(new Comparator<String>() {
public int compar... | 0 |
[CLS] public static Document convertHtmlToXml(final InputStream htmlInputStream, final String classpathXsltResource, final String encoding) {
Parser p = new Parser();
javax.xml.parsers.DocumentBuilder db;
try {
db = javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBu... | 1 |
[CLS] public void run() {
GZIPInputStream gzipInputStream = null;
try {
gzipInputStream = new GZIPInputStream(pipedInputStream);
IOUtils.copy(gzipInputStream, outputStream);
} catch (Throwable t) {
... | 1 |
[CLS] private String callPage(String urlStr) throws IOException {
URL url = new URL(urlStr);
BufferedReader reader = null;
StringBuilder result = new StringBuilder();
try {
reader = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
... | 1 |
[CLS] public static void copyFile(File from, File to) throws FileNotFoundException, IOException {
requireFile(from);
requireFile(to);
if (to.isDirectory()) {
to = new File(to, getFileName(from));
}
FileChannel sourceChannel = new FileInputStream(from).getChannel();
... | 1 |
[CLS] private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
jButton1.setEnabled(false);
for (int i = 0; i < max; i++) {
Card crd = WLP.getSelectedCard(WLP.jTable1.getSelectedRows()[i]);
String s, s2;
s = "";
s2 = "";
try {
... | 0 |
[CLS] public List<AnalyzerResult> analyze(LWComponent c, boolean tryFallback) {
List<AnalyzerResult> results = new ArrayList<AnalyzerResult>();
try {
URL url = new URL(DEFAULT_FLOW_URL + "?" + DEFAULT_INPUT + "=" + c.getLabel());
if (flow != null) {
url = new URL(... | 0 |
[CLS] public static String fetchURL(final String u) {
String retStr = "";
try {
final URL url = new URL(u);
final BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while ((line = reader.readLine()) != null) {... | 0 |
[CLS] public static void copia(File nombreFuente, File nombreDestino) throws IOException {
FileInputStream fis = new FileInputStream(nombreFuente);
FileOutputStream fos = new FileOutputStream(nombreDestino);
FileChannel canalFuente = fis.getChannel();
FileChannel canalDestino = fos.getCh... | 0 |
[CLS] public boolean clonarFichero(String rutaFicheroOrigen, String rutaFicheroDestino) {
System.out.println("");
System.out.println("*********** DENTRO DE 'clonarFichero' ***********");
boolean estado = false;
try {
FileInputStream entrada = new FileInputStream(rutaFicheroOr... | 1 |
[CLS] public void run() {
long starttime = (new Date()).getTime();
Matcher m = Pattern.compile("(\\S+);(\\d+)").matcher(Destination);
boolean completed = false;
if (OutFile.length() > IncommingProcessor.MaxPayload) {
logger.warn("Payload is too large!");
close();
... | 1 |
[CLS] private static void copyFile(final File sourceFile, final File destFile) throws IOException {
if (!destFile.exists()) {
if (!destFile.createNewFile()) {
throw new IOException("Destination file cannot be created: " + destFile.getPath());
}
}
FileChann... | 1 |
[CLS] @Override
public CasAssembly build() {
try {
prepareForBuild();
File casWorkingDirectory = casFile.getParentFile();
DefaultCasFileReadIndexToContigLookup read2contigMap = new DefaultCasFileReadIndexToContigLookup();
AbstractDefaultCasFileLookup readIdLoo... | 0 |
[CLS] public void create(Session session) {
Connection conn = session.getConnection(this);
Statement stat = null;
StringBuilder out = new StringBuilder(256);
Appendable sql = out;
List<MetaTable> tables = new ArrayList<MetaTable>();
List<MetaColumn> newColumns = new Array... | 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 copyFile(File file, File file1) throws IOException {
byte abyte0[] = new byte[512];
FileInputStream fileinputstream = new FileInputStream(file);
FileOutputStream fileoutputstream = new FileOutputStream(file1);
int i;
while ((i = fileinputstream.read(abyte0)) > 0... | 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 boolean authenticate(String plaintext) throws NoSuchAlgorithmException {
String[] passwordParts = this.password.split("\\$");
md = MessageDigest.getInstance("SHA-1");
md.update(passwordParts[1].getBytes());
isAuthenticated = toHex(md.digest(plaintext.getBytes())).equalsIgnor... | 0 |
[CLS] public void load(URL url) throws IOException {
if (url == null) {
throw new IllegalArgumentException("URL cannot be null.");
}
isFileBased = false;
this.url = url;
InputStream in = null;
try {
in = url.openStream();
load(in);
... | 0 |
[CLS] @Test
public void test_lookupType_FullSearch_TwoWords() throws Exception {
URL url = new URL(baseUrl + "/lookupType/deep+core");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("Accept", ... | 0 |
[CLS] private byte[] streamToBytes(InputStream in) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
IOUtils.copy(in, out);
} finally {
IOUtils.closeQuietly(in);
}
return out.toByteArray();
} [SEP] public static boolea... | 1 |
[CLS] protected URLConnection openConnection(URL url) throws IOException {
URLConnection con = url.openConnection();
if ("HTTPS".equalsIgnoreCase(url.getProtocol())) {
HttpsURLConnection scon = (HttpsURLConnection) con;
try {
scon.setSSLSocketF... | 0 |
[CLS] public ODFSignatureService(TimeStampServiceValidator timeStampServiceValidator, RevocationDataService revocationDataService, SignatureFacet signatureFacet, InputStream documentInputStream, OutputStream documentOutputStream, TimeStampService timeStampService, String role, IdentityDTO identity, byte[] photo, Digest... | 0 |
[CLS] public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
HttpClientInfo clientInfo = HttpUtil.parseClientInfo((HttpServletRequest) request);
if (request.getParameter("_debug_") != null) {
StringBuffer buffer = new StringBuffer();
... | 0 |
[CLS] public boolean executeUpdate(String strSql) throws SQLException {
getConnection();
boolean flag = false;
stmt = con.createStatement();
logger.info("###############::执行SQL语句操作(更新数据 无参数):" + strSql);
try {
if (0 < stmt.executeUpdate(strSql)) {
clos... | 0 |
[CLS] public void run() {
try {
URL url = new URL("http://www.sourceforge.net/projects/beobachter/files/beobachter_version.html");
InputStreamReader reader = new InputStreamReader(url.openStream());
BufferedReader buffer = new BufferedReader(reader);
String versio... | 0 |
[CLS] public String jsFunction_send(String postData) {
URL url = null;
try {
if (_uri.startsWith("http")) {
url = new URL(_uri);
} else {
url = new URL("file://./" + _uri);
}
} catch (MalformedURLException e) {
IdeLo... | 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 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 String getHash(String str) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(str.getBytes());
byte[] toChapter1Digest = md.digest();
return Keystore.hexEncode(toChapter1Digest);
} catch (Exception e) {
logger.e... | 0 |
[CLS] public void applyTo(File source, File target) throws IOException {
boolean failed = true;
FileInputStream fin = new FileInputStream(source);
try {
FileChannel in = fin.getChannel();
FileOutputStream fos = new FileOutputStream(target);
... | 0 |
[CLS] public static String getContent(String url, String code) {
HttpURLConnection connect = null;
try {
URL myurl = new URL(url);
connect = (HttpURLConnection) myurl.openConnection();
connect.setConnectTimeout(30000);
connect.setReadTimeout(30000);
... | 0 |
[CLS] public String getImageURL(String text) {
String imgURL = "";
try {
URL url = new URL("http://images.search.yahoo.com/search/images?p=" + URLEncoder.encode(text));
URLConnection connection = url.openConnection();
DataInputStream in = new DataInputStream(connectio... | 0 |
[CLS] public String readURL(URL url) throws JasenException {
OutputStream out = new ByteArrayOutputStream();
InputStream in = null;
String html = null;
NonBlockingStreamReader reader = null;
try {
in = url.openStream();
reader = new NonBlockingStreamReader... | 0 |
[CLS] private Component createLicensePane(String propertyKey) {
if (licesePane == null) {
String licenseText = "";
BufferedReader in = null;
try {
String filename = "conf/LICENSE.txt";
java.net.URL url = FileUtil.toURL(filename);
... | 0 |
[CLS] public static String upload_file(String sessionid, String localFilePath, String remoteTagPath) {
String jsonstring = "If you see this message, there is some problem inside the function:upload_file()";
String srcPath = localFilePath;
String uploadUrl = "https://s2.cloud.cm/rpc/json/?session... | 0 |
[CLS] public static String hash(String string, String algorithm, String encoding) throws UnsupportedEncodingException {
try {
MessageDigest digest = MessageDigest.getInstance(algorithm);
digest.update(string.getBytes(encoding));
byte[] encodedPassword = digest.digest();
... | 0 |
[CLS] public void signAndSend() throws Exception {
SSLContext sslContext = null;
try {
sslContext = SSLContext.getInstance("TLS");
X509TrustManager[] xtmArray = new X509TrustManager[] { xtm };
sslContext.init(null, xtmArray, new java.security.SecureRandom());
... | 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] private static void copy(File in, File out) throws IOException {
if (!out.getParentFile().isDirectory()) out.getParentFile().mkdirs();
FileChannel ic = new FileInputStream(in).getChannel();
FileChannel oc = new FileOutputStream(out).getChannel();
ic.transferTo(0, ic.size(), oc);
... | 1 |
[CLS] public ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt) throws VetoException {
if (key == null || fields == null) throw new VetoException("MD5Filter not configured");
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(getKey());
int[] ... | 0 |
[CLS] private void javaToHtml(File source, File destination) throws IOException {
Reader reader = new FileReader(source);
Writer writer = new FileWriter(destination);
JavaUtils.writeJava(reader, writer);
writer.flush();
writer.close();
} [SEP] public void sendMessageToServer(... | 0 |
[CLS] public void init(File file) {
InputStream is = null;
ByteArrayOutputStream os = null;
try {
is = new FileInputStream(file);
os = new ByteArrayOutputStream();
IOUtils.copy(is, os);
} catch (Throwable e) {
throw new VisualizerEngineExce... | 1 |
[CLS] public String md5(String phrase) {
MessageDigest m;
String coded = new String();
try {
m = MessageDigest.getInstance("MD5");
m.update(phrase.getBytes(), 0, phrase.length());
coded = (new BigInteger(1, m.digest()).toString(16)).toString();
} catch... | 0 |
[CLS] private void handleServerIntroduction(DataPacket serverPacket) {
DataPacketIterator iter = serverPacket.getDataPacketIterator();
String version = iter.nextString();
int serverReportedUDPPort = iter.nextUByte2();
_authKey = iter.nextUByte4();
_introKey = iter.nextUByte4();
... | 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] private static void addFileToZip(String path, String srcFile, ZipOutputStream zip, String prefix, String suffix) throws Exception {
File folder = new File(srcFile);
if (folder.isDirectory()) {
addFolderToZip(path, srcFile, zip, prefix, suffix);
} else {
if (isFileNa... | 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 void copyFilesIntoProject(HashMap<String, String> files) {
Set<String> filenames = files.keySet();
for (String key : filenames) {
String realPath = files.get(key);
if (key.equals("fw4ex.xml")) {
try {
FileReader in = new FileReader... | 0 |
[CLS] public String crypt(String suppliedPassword) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(suppliedPassword.getBytes());
String encriptedPassword = null;
try {
encriptedPassword = new String(Base64.encode(md.digest()), ... | 1 |
[CLS] private void copyFile(String file) {
FileChannel inChannel = null;
FileChannel outChannel = null;
try {
Date dt = new Date();
SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd HHmmss ");
File in = new File(file);
String[] name = file.split... | 0 |
[CLS] public void testReadNormal() throws Exception {
archiveFileManager.executeWith(new TemporaryFileExecutor() {
public void execute(File temporaryFile) throws Exception {
ZipArchive archive = new ZipArchive(temporaryFile.getPath());
InputStream input = archive.get... | 0 |
[CLS] protected String getGraphPath(String name) throws ServletException {
String hash;
try {
MessageDigest md = MessageDigest.getInstance(m_messagedigest_algorithm);
md.update(name.getBytes());
hash = bytesToHex(md.digest());
} catch (NoSuchAlgorithmException... | 1 |
[CLS] public static byte[] post(String path, Map<String, String> params, String encode) throws Exception {
StringBuilder parambuilder = new StringBuilder("");
if (params != null && !params.isEmpty()) {
for (Map.Entry<String, String> entry : params.entrySet()) {
parambuilder.a... | 0 |
[CLS] private void weightAndPlaceClasses() {
int rows = getRows();
for (int curRow = _maxPackageRank; curRow < rows; curRow++) {
xPos = getHGap() / 2;
ClassdiagramNode[] rowObject = getObjectsInRow(curRow);
for (int i = 0; i < rowObject.length; i++) {
... | 0 |
[CLS] private void getImage(String filename) throws MalformedURLException, IOException, SAXException, FileNotFoundException {
String url = Constants.STRATEGICDOMINATION_URL + "/images/gameimages/" + filename;
WebRequest req = new GetMethodWebRequest(url);
SiteResponse response = getSiteResponse(... | 1 |
[CLS] public String getHtmlCode(String urlString) {
StringBuffer result = new StringBuffer();
BufferedReader in = null;
try {
URL url = new URL((urlString));
URLConnection con = url.openConnection();
in = new BufferedReader(new InputStreamReader(con.getInputSt... | 1 |
[CLS] public static void copyFile(File src, File dest, boolean notifyUserOnError) {
if (src.exists()) {
try {
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(dest));
BufferedInputStream in = new BufferedInputStream(new FileInputStream(src));
... | 1 |
[CLS] private boolean downloadBlacklist() {
boolean blacklist_updated = false;
try {
mLogger.debug("Attempting to download MT blacklist");
URL url = new URL(blacklistURL);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.... | 0 |
[CLS] public static Document validateXml(File messageFile, URL inputUrl, String[] catalogs) throws IOException, ParserConfigurationException, Exception, SAXException, FileNotFoundException {
InputSource source = new InputSource(inputUrl.openStream());
Document logDoc = DomUtil.getNewDom();
XMLRe... | 1 |
[CLS] private void CopyTo(File dest) throws IOException {
FileReader in = null;
FileWriter out = null;
int c;
try {
in = new FileReader(image);
out = new FileWriter(dest);
while ((c = in.read()) != -1) out.write(c);
} finally {
if (... | 1 |
[CLS] public int update(BusinessObject o) throws DAOException {
int update = 0;
Account acc = (Account) o;
try {
PreparedStatement pst = connection.prepareStatement(XMLGetQuery.getQuery("UPDATE_ACCOUNT"));
pst.setString(1, acc.getName());
pst.setString(2, acc.... | 0 |
[CLS] public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(inputResource.getInputStream()));
File targetDirectoryAsFile = new File(targetDirectory);
if (!targetDirectoryAsFile.exis... | 1 |
[CLS] public static void main(String[] args) throws Exception {
for (int n = 0; n < 8; n++) {
new Thread() {
public void run() {
try {
URL url = new URL("http://localhost:8080/WebGISTileServer/index.jsp?token_timeout=true");
... | 0 |
[CLS] protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
UsuarioBll usuarioBll = new UsuarioBll();
String senha = "";
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.up... | 1 |
[CLS] private MimeTypes() {
try {
final URL url = RES.getURL("types");
final InputStream is = url.openStream();
final BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line = br.readLine();
while (line != null) {
... | 0 |
[CLS] public boolean saveNote(NoteData n) {
String query;
try {
conn.setAutoCommit(false);
Statement stmt = null;
ResultSet rset = null;
stmt = conn.createStatement();
query = "select * from notes where noteid = " + n.getID();
rset ... | 0 |
[CLS] public static String MD5(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md;
md = MessageDigest.getInstance("MD5");
byte[] md5hash;
md.update(text.getBytes("iso-8859-1"), 0, text.length());
md5hash = md.digest();
return con... | 1 |
[CLS] private void documentFileChooserActionPerformed(java.awt.event.ActionEvent evt) {
if (evt.getActionCommand().equals(JFileChooser.APPROVE_SELECTION)) {
File selectedFile = documentFileChooser.getSelectedFile();
File collectionCopyFile;
String newDocumentName = selectedFi... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.