text string | label int64 |
|---|---|
[CLS] public String Hash(String plain) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(plain.getBytes(), 0, plain.length());
return new BigInteger(1, md5.digest()).toString(16);
} catch (Exception ex) {
Log.serverlogger.warn("No su... | 0 |
[CLS] public static void Sample2(String myField, String condition1, String condition2) throws SQLException {
Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost/test", "user", "password");
connection.setAutoCommit(false);
Statement st = connection.createStatement();
String sql... | 0 |
[CLS] public synchronized List<AnidbSearchResult> getAnimeTitles() throws Exception {
URL url = new URL("http", host, "/api/animetitles.dat.gz");
ResultCache cache = getCache();
@SuppressWarnings("unchecked") List<AnidbSearchResult> anime = (List) cache.getSearchResult(null, Locale.ROOT);
... | 0 |
[CLS] public TVRageShowInfo(String xmlShowName, String xmlSearchBy) {
String[] tmp, tmp2;
String line = "";
this.usrShowName = xmlShowName;
try {
URL url = new URL("http://www.tvrage.com/quickinfo.php?show=" + xmlShowName.replaceAll(" ", "%20"));
BufferedReader in... | 0 |
[CLS] protected static boolean copyFile(File src, File dest) {
try {
if (!dest.exists()) {
dest.createNewFile();
}
FileInputStream fis = new FileInputStream(src);
FileOutputStream fos = new FileOutputStream(dest);
byte[] temp = new byte... | 1 |
[CLS] private boolean Try(URL url, Metafile mf) throws Throwable {
InputStream is = null;
HttpURLConnection con = null;
boolean success = false;
try {
con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.connect();
... | 0 |
[CLS] @Override
public String fetchURL(String urlString) throws ServiceException {
try {
URL url = new URL(urlString);
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
String content = "";
String line;
while ((li... | 0 |
[CLS] public void covertFile(File file) throws IOException {
if (!file.isFile()) {
return;
}
Reader reader = null;
OutputStream os = null;
File newfile = null;
String filename = file.getName();
boolean succeed = false;
try {
newfile... | 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;... | 0 |
[CLS] public void setNewPassword(String password) {
try {
final MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(password.getBytes());
final String encrypted = "{MD5}" + new String(Base64Encoder.encode(digest.digest()));
setUserPassword(encry... | 1 |
[CLS] public JarClassLoader(ClassLoader parent) {
super(parent);
initLogger();
hmClass = new HashMap<String, Class<?>>();
lstJarFile = new ArrayList<JarFileInfo>();
hsDeleteOnExit = new HashSet<File>();
String sUrlTopJar = null;
pd = getClass().getProtectionDomain... | 0 |
[CLS] public static String digest(String ha1, String ha2, String nonce) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(getBytes(ha1, ISO_8859_1));
md.update((byte) ':');
md.update(getBytes(nonce, ISO_8859_1));
md.update((byte) '... | 0 |
[CLS] public void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
try {
int maxCount = (64 * 1024 * 1024) - (32 * 1024);
long size = inChannel.s... | 1 |
[CLS] private final long test(final boolean applyFilter, final int executionCount) throws NoSuchAlgorithmException, NoSuchPaddingException, FileNotFoundException, IOException, RuleLoadingException {
final boolean stripHtmlEnabled = true;
final boolean injectSecretTokensEnabled = true;
final bool... | 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] private String getData(String requestUrl) throws AuthenticationException, IOException {
URL url = new URL(requestUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
String header;
try {
header = oauthAuthenticator.getHttpAuthorizationHeader(url.toSt... | 0 |
[CLS] public static void copyFile(File src, File dst) throws IOException {
BufferedInputStream is = new BufferedInputStream(new FileInputStream(src));
BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(dst));
byte[] buf = new byte[1024];
int count = 0;
while ... | 0 |
[CLS] private String AddAction(ResultSet node, String modo) throws SQLException {
Connection cn = null;
Connection cndef = null;
String schema = boRepository.getDefaultSchemaName(boApplication.getDefaultApplication()).toLowerCase();
try {
cn = this.getRepositoryConnection(p_c... | 0 |
[CLS] public static boolean copy(File source, File target) {
try {
if (!source.exists()) return false;
target.getParentFile().mkdirs();
InputStream input = new FileInputStream(source);
OutputStream output = new FileOutputStream(target);
byte[] buf = ne... | 1 |
[CLS] private void preprocessObjects(GeoObject[] objects) throws IOException {
System.out.println("objects.length " + objects.length);
for (int i = 0; i < objects.length; i++) {
String fileName = objects[i].getPath();
int dotindex = fileName.lastIndexOf(".");
dotindex... | 0 |
[CLS] public static void main(String args[]) throws Exception {
FileInputStream fin = new FileInputStream("D:/work/test.txt");
FileOutputStream fout = new FileOutputStream("D:/work/output.txt");
FileChannel inChannel = fin.getChannel();
FileChannel outChannel = fout.getChannel();
... | 0 |
[CLS] FileCacheInputStreamFountain(FileCacheInputStreamFountainFactory factory, InputStream in) throws IOException {
file = factory.createFile();
OutputStream out = new FileOutputStream(file);
IOUtils.copy(in, out);
in.close();
out.close();
} [SEP] public static boolean encod... | 1 |
[CLS] public static void main(String args[]) {
URL url = null;
try {
url = new URL(urlString);
} catch (MalformedURLException e) {
System.err.println(e.toString());
System.exit(1);
}
try {
InputStream ins = url.openStream();
... | 1 |
[CLS] public static SearchItem loadRecord(String id, boolean isContact) {
String line = null;
try {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(isContact ? URL_RECORD_CONTACT : URL_RECORD_COMPANY);
List<NameValuePair> nameV... | 0 |
[CLS] public void importarEmpresasAbertas(File pArquivoTXT, Andamento pAndamento) throws FileNotFoundException, SQLException {
int numeroDoRegistro = -1;
Scanner in = null;
Statement stmtLimpezaInicialDestino = conDestino.createStatement();
String sql = "TRUNCATE TABLE TMP_TB_CIA_ABERTA"... | 0 |
[CLS] private static String calculateScenarioMD5(Scenario scenario) throws Exception {
MessageDigest md = MessageDigest.getInstance("MD5");
Vector<JTest> allTests = scenario.getTests();
for (JTest t : allTests) {
String name = t.getTestName() + t.getTestId();
String param... | 1 |
[CLS] public boolean login() {
if (super.isAuthenticated()) return true;
try {
if (client == null) {
client = new FTPClient();
FTPClientConfig config = new FTPClientConfig();
client.configure(config);
}
if (!client.isCon... | 0 |
[CLS] protected Ontology loadOntology(String ontologyIri) throws IOException, ParserException, InvalidModelException {
assert ontologyIri != null;
URL url = null;
Ontology ontology = null;
url = new URL(ontologyIri);
InputStream is = url.openStream();
TopEntity[] identifi... | 0 |
[CLS] public boolean load() {
if (getFilename() != null && getFilename().length() > 0) {
try {
File file = new File(PreferencesManager.getDirectoryLocation("macros") + File.separator + getFilename());
URL url = file.toURL();
InputStreamReader isr = new... | 0 |
[CLS] public void deleteSingle(String tbName, String idFld, String id) throws Exception {
String tmp = "";
PreparedStatement prepStmt = null;
try {
if (tbName == null || tbName.length() == 0 || id == null || id.length() == 0) throw new Exception("Invalid parameter");
con ... | 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 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 =... | 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... | 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 void addRegisterInfo(HttpServletRequest request) throws ApplicationException {
String[] pids = request.getParameterValues("pid");
if (pids == null || pids.length <= 0) throw new ApplicationException("��ѡ��Ҫ���IJ�Ʒ");
RegisterDao registerDao = new RegisterDao();
Register regis... | 0 |
[CLS] public static void copy(final File src, File dst, final boolean overwrite) throws IOException, IllegalArgumentException {
if (!src.isFile() || !src.exists()) {
throw new IllegalArgumentException("Source file '" + src.getAbsolutePath() + "' not found!");
}
if (dst.exists()) {
... | 1 |
[CLS] public boolean saveVideoXMLOnWebserver(String text) {
boolean error = false;
FTPClient ftp = new FTPClient();
try {
int reply;
ftp.connect(this.getWebserver().getUrl());
System.out.println("Connected to " + this.getWebserver().getUrl() + ".");
... | 0 |
[CLS] private void getRandomGUID(boolean secure) {
MessageDigest md5 = null;
StringBuffer sbValueBeforeMD5 = new StringBuffer();
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
}
try {
long time = System.current... | 0 |
[CLS] public static String sendGetRequest(String endpoint, String requestParameters) {
if (endpoint == null) return null;
String result = null;
if (endpoint.startsWith("http://")) {
try {
StringBuffer data = new StringBuffer();
String urlStr = endpoint... | 1 |
[CLS] private boolean importTablesData(Connection conn) {
try {
boolean status = true;
boolean autoCommit = conn.getAutoCommit();
conn.setAutoCommit(false);
String dbType = this.getFromSession("database");
List statements = ParseDBDumpFile.parse(System... | 1 |
[CLS] public String postFileRequest(String fileName, String internalFileName) throws Exception {
status = STATUS_INIT;
String responseString = null;
String requestStringPostFix = new String("");
if (isThreadStopped) {
return "";
}
s... | 0 |
[CLS] boolean copyFileStructure(File oldFile, File newFile) {
if (oldFile == null || newFile == null) return false;
File searchFile = newFile;
do {
if (oldFile.equals(searchFile)) return false;
searchFile = searchFile.getParentFile();
} while (searchFile != null);... | 1 |
[CLS] @Override
public void run() {
if (mMode == 0) {
long currentVersion = Version.extractVersion(App.getVersion());
if (currentVersion == 0) {
mMode = 2;
RESULT = MSG_UP_TO_DATE;
return;
}
long versionAvailable... | 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 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 static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
try {
if (System.getProperty("os.name").toUpperCase().indexOf("WIN") != -1) {
... | 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... | 1 |
[CLS] private static synchronized void calcLocalFileHash() {
long startTime = System.currentTimeMillis();
if (currentFileHash != null) return;
List fileList = getAllFiles("/", new AllFilesFilter());
int len = 0;
byte[] buf = new byte[1024];
try {
MessageDigest... | 0 |
[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 Object execute(Connection connection) throws JAXRException {
RegistryObject registryObject = connection.getRegistryService().getBusinessQueryManager().getRegistryObject(id);
if (registryObject instanceof ExtrinsicObject) {
ExtrinsicObject extr... | 1 |
[CLS] public HttpUrlConnectionCall(HttpClientHelper helper, String method, String requestUri, boolean hasEntity) throws IOException {
super(helper, method, requestUri);
if (requestUri.startsWith("http")) {
URL url = new URL(requestUri);
this.connection = (HttpURLConnection) url.o... | 0 |
[CLS] public static Checksum checksum(File file, Checksum checksum) throws IOException {
if (file.isDirectory()) {
throw new IllegalArgumentException("Checksums can't be computed on directories");
}
InputStream in = null;
try {
in = new CheckedInputStream(new File... | 1 |
[CLS] @Override
protected URLConnection openConnection(URL url) throws IOException {
final String urlPath = url.getPath();
final int status;
final String path;
String statusAsString = extractValue(urlPath, STATUS_REGEX, STATUS_CAPTURE);
status = statusAsString == null ? 200 :... | 0 |
[CLS] public static String getHash(String text) {
if (text == null) return null;
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(text.getBytes());
byte[] hashedTextBytes = md.digest();
BigInteger hashedTextBigInteger = new BigInteger(1... | 1 |
[CLS] private void doDissemTest(String what, boolean redirectOK) throws Exception {
final int num = 30;
System.out.println("Getting " + what + " " + num + " times...");
int i = 0;
try {
URL url = new URL(BASE_URL + "/get/" + what);
for (i = 0; i < num; i++) {
... | 0 |
[CLS] public static long writeInputStreamToOutputStream(final InputStream in, final OutputStream out) {
long size = 0;
try {
size = IOUtils.copyLarge(in, out);
} catch (IOException e1) {
e1.printStackTrace();
}
return size;
} [SEP] public void copyFile... | 1 |
[CLS] @Override
public void runTask(HashMap pjobParameters) throws Exception {
if (hasRequiredResources(isSubTask())) {
String lstrSource = getSourceFilename();
String lstrTarget = getTargetFilename();
if (getSourceDirectory() != null) {
lstrSource = getSo... | 1 |
[CLS] public InputStream getFileStream(String filePath) {
if (this.inJar) {
try {
URL url = getClassResourceUrl(this.getClass(), filePath);
if (url != null) {
return url.openStream();
}
} catch (IOException ioe) {
... | 0 |
[CLS] public String merge(int width, int height) throws Exception {
htErrors.clear();
sendGetImageRequests(width, height);
Vector files = new Vector();
ConcurrentHTTPTransactionHandler c = new ConcurrentHTTPTransactionHandler();
c.setCache(cache);
c.checkIfModified(false)... | 1 |
[CLS] public String getSummaryText() {
if (summaryText == null) {
for (Iterator iter = xdcSources.values().iterator(); iter.hasNext(); ) {
XdcSource source = (XdcSource) iter.next();
File packageFile = new File(source.getFile().getParentFile(), "xdc-package.html");
... | 1 |
[CLS] public static BufferedInputStream getEventAttacchment(final String url) throws IOException {
int slashIndex = url.lastIndexOf("/");
String encodedUrl = url.substring(0, slashIndex + 1) + URLEncoder.encode(url.substring(slashIndex + 1), "UTF-8");
String urlwithtoken = encodedUrl + "?ticket=... | 0 |
[CLS] private void fileMaker() {
try {
long allData = 0;
double a = 10;
int range = 0;
int blockLength = 0;
File newFile = new File(mfr.getFilename() + ".part");
if (newFile.exists()) {
newFile.delete();
}
... | 1 |
[CLS] @Override
public void parse() throws DocumentException, IOException {
URL url = new URL(getDataUrl());
URLConnection con = url.openConnection();
BufferedReader bStream = new BufferedReader(new InputStreamReader(con.getInputStream()));
String s = bStream.readLine();
bStr... | 0 |
[CLS] public void salva(UploadedFile imagem, Usuario usuario) {
File destino;
if (usuario.getId() == null) {
destino = new File(pastaImagens, usuario.hashCode() + ".jpg");
} else {
destino = new File(pastaImagens, usuario.getId() + ".jpg");
}
try {
... | 1 |
[CLS] public static void copy(String sourceFile, String targetFile) throws IOException {
FileChannel sourceChannel = new FileInputStream(sourceFile).getChannel();
FileChannel targetChannel = new FileOutputStream(targetFile).getChannel();
targetChannel.transferFrom(sourceChannel, 0, sourceChannel... | 1 |
[CLS] public static void copyFile(File sourceFile, File destFile) throws IOException {
if (!destFile.exists()) {
destFile.createNewFile();
}
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChanne... | 1 |
[CLS] private void show(String fileName, HttpServletResponse response) throws IOException {
TelnetInputStream ftpIn = ftpClient_sun.get(fileName);
OutputStream out = null;
try {
out = response.getOutputStream();
IOUtils.copy(ftpIn, out);
} finally {
if... | 1 |
[CLS] public InputStream getParameterAsInputStream(String key) throws UndefinedParameterError, IOException {
String urlString = getParameter(key);
if (urlString == null) return null;
try {
URL url = new URL(urlString);
InputStream stream = url.openStream();
re... | 0 |
[CLS] private void copy(File in, File out) {
log.info("Copying yam file from: " + in.getName() + " to: " + out.getName());
try {
FileChannel ic = new FileInputStream(in).getChannel();
FileChannel oc = new FileOutputStream(out).getChannel();
ic.transferTo(0, ic.size(),... | 1 |
[CLS] byte[] calculateDigest(String value) {
try {
MessageDigest mg = MessageDigest.getInstance("SHA1");
mg.update(value.getBytes());
return mg.digest();
} catch (Exception e) {
throw Bark.unchecker(e);
}
} [SEP] public static String getDigest(... | 1 |
[CLS] public static void copy(String a, String b) throws IOException {
File inputFile = new File(a);
File outputFile = new File(b);
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;
while ((c = in.read()) != -1) out.write(c);
... | 1 |
[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] @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String contentType = req.getParameter("type");
String arg = req.getParameter("file");
if (arg == null) {
resp.sendError(404, "Missing File Arg");
... | 1 |
[CLS] @Override
public byte[] read(String path) throws PersistenceException {
path = fmtPath(path);
try {
S3Object fileObj = s3Service.getObject(bucketObj, path);
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtils.copy(fileObj.getDataInputStream(), o... | 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 MMissing load(URL url) throws IOException {
MMissing ret = new MMissing();
InputStream is = url.openStream();
try {
Reader r = new InputStreamReader(is);
BufferedReader br = new BufferedReader(r);
String line;
while ((line = br.... | 1 |
[CLS] @Override
public int write(FileStatus.FileTrackingStatus fileStatus, InputStream input, PostWriteAction postWriteAction) throws WriterException, InterruptedException {
String key = logFileNameExtractor.getFileName(fileStatus);
int wasWritten = 0;
FileOutputStreamPool fileOutputStreamPo... | 1 |
[CLS] public void saveUserUpFile(UserInfo userInfo, String distFileName, InputStream instream) throws IOException {
String fullPicFile = BBSCSUtil.getUserWebFilePath(userInfo.getId()) + distFileName;
String fullPicFileSmall = BBSCSUtil.getUserWebFilePath(userInfo.getId()) + distFileName + Constant.IMG_S... | 1 |
[CLS] private JButton getButtonImagen() {
if (buttonImagen == null) {
buttonImagen = new JButton();
buttonImagen.setText("Cargar Imagen");
buttonImagen.setIcon(new ImageIcon(getClass().getResource("/data/icons/view_sidetree.png")));
buttonImagen.addActionListener(... | 0 |
[CLS] @SuppressWarnings("unchecked")
protected void processTransformAction(HttpServletRequest request, HttpServletResponse response, String action) throws Exception {
File transformationFile = null;
String tr = request.getParameter(Definitions.REQUEST_PARAMNAME_XSLT);
if (StringUtils.isNotBl... | 1 |
[CLS] public static void main(String[] args) {
if (args.length != 3) {
System.out.println("Usage: HexStrToBin enc/dec <infileName> <outfilename>");
System.exit(1);
}
try {
ByteArrayOutputStream os = new ByteArrayOutputStream();
InputStream in = new... | 1 |
[CLS] public void test() throws Exception {
File temp = File.createTempFile("test", ".test");
temp.deleteOnExit();
StorageFile s = new StorageFile(temp, "UTF-8");
s.addText("Test");
s.getOutputStream().write("ing is important".getBytes("UTF-8"));
s.getWriter().write(" but... | 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 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 check(Object credentials) {
try {
byte[] digest = null;
if (credentials instanceof Password || credentials instanceof String) {
synchronized (__TYPE) {
if (__md == null) __md = MessageDigest.getInstance("MD5");
... | 0 |
[CLS] public static void registerProviders(ResteasyProviderFactory factory) throws Exception {
Enumeration<URL> en = Thread.currentThread().getContextClassLoader().getResources("META-INF/services/" + Providers.class.getName());
LinkedHashSet<String> set = new LinkedHashSet<String>();
while (en.h... | 1 |
[CLS] private void loadProperties() {
if (properties == null) {
properties = new Properties();
try {
URL url = getClass().getResource(propsFile);
properties.load(url.openStream());
} catch (IOException ioe) {
ioe.printStackTrace... | 0 |
[CLS] public static void perform(ChangeSet changes, ArchiveInputStream in, ArchiveOutputStream out) throws IOException {
ArchiveEntry entry = null;
while ((entry = in.getNextEntry()) != null) {
System.out.println(entry.getName());
boolean copy = true;
for (Iterator it... | 1 |
[CLS] public static String md(String passwd) {
MessageDigest md5 = null;
String digest = passwd;
try {
md5 = MessageDigest.getInstance("MD5");
md5.update(passwd.getBytes());
byte[] digestData = md5.digest();
digest = byteArrayToHex(digestData);
... | 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] @Test
public void testClient() throws ClientProtocolException, IOException {
HttpClient httpclient = new DefaultHttpClient();
HttpHost proxy = new HttpHost("127.0.0.1", 1280, "http");
HttpGet httpget = new HttpGet("http://a.b.c.d/pdn/");
httpclient.getParams().setParameter(Conn... | 0 |
[CLS] private void preprocessObjects(GeoObject[] objects) throws IOException {
System.out.println("objects.length " + objects.length);
for (int i = 0; i < objects.length; i++) {
String fileName = objects[i].getPath();
int dotindex = fileName.lastIndexOf(".");
dotindex... | 1 |
[CLS] public static final boolean checkForUpdate(final String currentVersion, final String updateURL, boolean noLock) throws Exception {
try {
final String parentFDTConfDirName = System.getProperty("user.home") + File.separator + ".fdt";
final String fdtUpdateConfFileName = "update.prope... | 1 |
[CLS] private void createTree(DefaultMutableTreeNode top) throws MalformedURLException, ParserConfigurationException, SAXException, IOException {
InputStream stream;
URL url = new URL(SHIPS_URL + view.getBaseurl());
try {
stream = url.openStream();
} catch (Exception e) {
... | 0 |
[CLS] public static void main(String[] argz) {
int X, Y, Z;
X = 256;
Y = 256;
Z = 256;
try {
String work_folder = "C:\\Documents and Settings\\Entheogen\\My Documents\\school\\jung\\vol_data\\CT_HEAD3";
FileOutputStream out_stream = new FileOutputStream(ne... | 0 |
[CLS] public static void copy(Object arg1, Object arg2) {
Writer writer = null;
Reader reader = null;
InputStream inStream = null;
OutputStream outStream = null;
try {
if (arg2 instanceof Writer) {
writer = (Writer) arg2;
if (arg1 insta... | 0 |
[CLS] public void onUploadClicked(Event event) {
Media[] medias = null;
try {
medias = Fileupload.get("Select one or more files to upload to " + "the current directory.", "Upload Files", 5);
} catch (Exception e) {
log.error("An exception occurred when displaying the file... | 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] public static String md5Encrypt(final String txt) {
String enTxt = txt;
MessageDigest md = null;
try {
md = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
logger.error("Error:", e);
}
if (null != md) {
by... | 0 |
[CLS] public static boolean copyFile(File source, File dest) throws IOException {
int answer = JOptionPane.YES_OPTION;
if (dest.exists()) {
answer = JOptionPane.showConfirmDialog(null, "File " + dest.getAbsolutePath() + "\n already exists. Overwrite?", "Warning", JOptionPane.YES_NO_OPTION);... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.