text string | label int64 |
|---|---|
[CLS] public String getTextData() {
if (tempFileWriter != null) {
try {
tempFileWriter.flush();
tempFileWriter.close();
FileReader in = new FileReader(tempFile);
StringWriter out = new StringWriter();
int len;
... | 1 |
[CLS] protected void channelConnected() throws IOException {
MessageDigest md = null;
String digest = "";
try {
String userid = nateon.getUserId();
if (userid.endsWith("@nate.com")) userid = userid.substring(0, userid.lastIndexOf('@'));
md = MessageDigest.getI... | 0 |
[CLS] public String getMessageofTheDay(String id) {
StringBuffer mod = new StringBuffer();
int serverModId = 0;
int clientModId = 0;
BufferedReader input = null;
try {
URL url = new URL(FlyShareApp.BASE_WEBSITE_URL + "/mod.txt");
input = new BufferedReader... | 0 |
[CLS] @SuppressWarnings("unchecked")
public static void unzip(String zipFileName, String folder, boolean isCreate) throws IOException {
File file = new File(zipFileName);
File folderfile = null;
if (file.exists() && file.isFile()) {
String mfolder = folder == null ? file.getParen... | 1 |
[CLS] protected File getFile(NameCategory category) throws IOException {
File home = new File(System.getProperty("user.dir"));
String fileName = String.format("%s.txt", category);
File file = new File(home, fileName);
if (file.exists()) {
return file;
} else {
... | 0 |
[CLS] protected void copy(File source, File destination) throws IOException {
final FileChannel inChannel = new FileInputStream(source).getChannel();
final FileChannel outChannel = new FileOutputStream(destination).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChan... | 1 |
[CLS] private void simulate() throws Exception {
BufferedWriter out = null;
out = new BufferedWriter(new FileWriter(outFile));
out.write("#Thread\tReputation\tAction\n");
out.flush();
System.out.println("Simulate...");
File file = new File(trsDemoSimulationfile);
... | 0 |
[CLS] public void doFTP() throws BuildException {
FTPClient ftp = null;
try {
task.log("Opening FTP connection to " + task.getServer(), Project.MSG_VERBOSE);
ftp = new FTPClient();
if (task.isConfigurationSet()) {
ftp = FTPConfigurator.configure(ftp, t... | 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 static void copy(File src, File dst) {
try {
InputStream is = null;
OutputStream os = null;
try {
is = new BufferedInputStream(new FileInputStream(src), BUFFER_SIZE);
os = new BufferedOutputStream(new FileOutputStream(dst), BUFFER_... | 1 |
[CLS] private void sendData(HttpServletResponse response, MediaBean mediaBean) throws IOException {
if (logger.isInfoEnabled()) logger.info("sendData[" + mediaBean + "]");
response.setContentLength(mediaBean.getContentLength());
response.setContentType(mediaBean.getContentType());
respon... | 1 |
[CLS] public void startImport(ActionEvent evt) {
final PsiExchange psiExchange = PsiExchangeFactory.createPsiExchange(IntactContext.getCurrentInstance().getSpringContext());
for (final URL url : urlsToImport) {
try {
if (log.isInfoEnabled()) log.info("Importing: " + url);
... | 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] public RandomAccessFileOrArray(URL url) throws IOException {
InputStream is = url.openStream();
try {
this.arrayIn = InputStreamToArray(is);
} finally {
try {
is.close();
} catch (IOException ioe) {
}
}
} [SEP] pub... | 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 decompress(File source, File destination) {
FileOutputStream outputStream;
ZipInputStream inputStream;
try {
outputStream = null;
inputStream = new ZipInputStream(new FileInputStream(source));
int read;
byte buffer[] = n... | 1 |
[CLS] public static void copy(File sourceFile, File destFile) throws IOException {
if (!destFile.exists()) {
destFile.createNewFile();
}
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChannel();... | 1 |
[CLS] public static String hashMD5(String passw) {
String passwHash = "";
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(passw.getBytes());
byte[] result = md.digest();
StringBuffer sb = new StringBuffer();
for (int i = 0;... | 0 |
[CLS] public static void zipMapBos(DitaBoundedObjectSet mapBos, File outputZipFile, MapBosProcessorOptions options) throws Exception {
log.debug("Determining zip file organization...");
BosVisitor visitor = new DxpFileOrganizingBosVisitor();
visitor.visit(mapBos);
if (!options.isQuiet())... | 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();
long size = in.size();
MappedByteBuffer bu... | 0 |
[CLS] public String readFile(String filename) throws UnsupportedEncodingException, FileNotFoundException, IOException {
File f = new File(baseDir);
f = new File(f, filename);
StringWriter w = new StringWriter();
Reader fr = new InputStreamReader(new FileInputStream(f), "UTF-8");
... | 1 |
[CLS] public int add(WebService ws) throws FidoDatabaseException {
try {
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
String sql = "insert into WebServices (MethodName, ServiceURI) " + "values ('" + ws.getMethodName() +... | 0 |
[CLS] private void post(String title, Document content, Set<String> tags) throws HttpException, IOException, TransformerException {
PostMethod method = null;
try {
method = new PostMethod("http://www.blogger.com/feeds/" + this.blogId + "/posts/default");
method.addRequestHeader("... | 0 |
[CLS] @Test
public final void testImportODS() throws Exception {
URL url = ODSTableImporterTest.class.getResource("/Messages.ods");
InputStream in = url.openStream();
ODSTableImporter b = new ODSTableImporter();
b.importODS(in, null);
assertMessagesOds(b);
} [SEP] protect... | 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 String[] putFECSplitFile(String uri, File file, int htl, boolean mode) {
FcpFECUtils fecutils = null;
Vector segmentHeaders = null;
Vector segmentFileMaps = new Vector();
Vector checkFileMaps = new Vector();
Vector segmentKeyMaps = new Vector();
Vector... | 1 |
[CLS] private InputStream loadFromUrl(URL url, String contentType) throws IOException {
Proxy proxy = null;
if (isUseProxy) {
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new Password... | 0 |
[CLS] public URLConnection makeURLConnection(String server) throws IOException {
if (server == null) {
connection = null;
} else {
URL url = new URL("http://" + server + "/Bob/QueryXindice");
connection = url.openConnection();
connection.setDoOutput(true);... | 0 |
[CLS] public void elimina(Pedido pe) throws errorSQL, errorConexionBD {
System.out.println("GestorPedido.elimina()");
int id = pe.getId();
String sql;
Statement stmt = null;
try {
gd.begin();
sql = "DELETE FROM pedido WHERE id=" + id;
System.ou... | 0 |
[CLS] public static String getMD5(final String text) {
if (null == text) return null;
final MessageDigest algorithm;
try {
algorithm = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
algorit... | 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 byte[] getImage(String urlpath) throws Exception {
URL url = new URL(urlpath);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setConnectTimeout(6 * 1000);
if (conn.getResponseCode() == 200) {
InputSt... | 0 |
[CLS] public static void unzip(final File file, final ZipFile zipFile, final File targetDirectory) throws PtException {
LOG.info("Unzipping zip file '" + file.getAbsolutePath() + "' to directory " + "'" + targetDirectory.getAbsolutePath() + "'.");
assert (file.exists() && file.isFile());
if (tar... | 0 |
[CLS] public void run() throws Exception {
logger.debug("#run enter");
logger.debug("#run lineId : " + lineId);
logger.debug("#run quantityNew : " + quantityNew);
logger.debug("#run priceNew : " + priceNew);
ResultSet rs = null;
PreparedStatement ps = null;
try {
... | 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 copy(File source, File target) throws IOException {
FileInputStream in = new FileInputStream(source);
FileOutputStream out = new FileOutputStream(target);
byte[] buffer = new byte[4096];
int no = 0;
try {
while ((no = in.read(buffer)) != -1) ... | 1 |
[CLS] private String loadSchemas() {
StringWriter writer = new StringWriter();
try {
IOUtils.copy(CoreOdfValidator.class.getResourceAsStream("schema_list.properties"), writer);
} catch (IOException e) {
e.printStackTrace();
}
return writer.toString();
... | 1 |
[CLS] public static void copyFile(String sourceFilePath, String destFilePath) throws IOException {
FileChannel in = null;
FileChannel out = null;
try {
in = new FileInputStream(sourceFilePath).getChannel();
out = new FileOutputStream(destFilePath).getChannel();
... | 1 |
[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] public static String obterConteudoSite(String u) {
URL url;
try {
url = new URL(u);
URLConnection conn = null;
if (proxy != null) conn = url.openConnection(proxy.getProxy()); else conn = url.openConnection();
conn.setDoOutput(true);
Buffe... | 0 |
[CLS] protected synchronized AbstractBaseObject insert(AbstractBaseObject obj) throws ApplicationException {
PreparedStatement preStat = null;
StringBuffer sqlStat = new StringBuffer();
DmsRelationalWord tmpDmsRelationalWord = (DmsRelationalWord) ((DmsRelationalWord) obj).clone();
synchr... | 0 |
[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... | 1 |
[CLS] public static void copyFile(final File in, final File out) throws IOException {
final FileChannel sourceChannel = new FileInputStream(in).getChannel();
final FileChannel destinationChannel = new FileOutputStream(out).getChannel();
sourceChannel.transferTo(0, sourceChannel.size(), destinati... | 1 |
[CLS] @org.junit.Test
public void testReadWrite() throws Exception {
final String reference = "testString";
final Reader reader = new StringReader(reference);
final StringWriter osString = new StringWriter();
final Reader teeStream = new TeeReaderWriter(reader, osString);
IOU... | 1 |
[CLS] private static boolean genCustomerLocationsFileAndCustomerIndexFile(String completePath, String masterFile, String CustLocationsFileName, String CustIndexFileName) {
try {
TIntObjectHashMap CustInfoHash = new TIntObjectHashMap(480189, 1);
File inFile = new File(completePath + fSep ... | 0 |
[CLS] public File createTemporaryFile() throws IOException {
URL url = clazz.getResource(resource);
if (url == null) {
throw new IOException("No resource available from '" + clazz.getName() + "' for '" + resource + "'");
}
String extension = getExtension(resource);
St... | 0 |
[CLS] public String decrypt(String text, String passphrase, int keylen) {
RC2ParameterSpec parm = new RC2ParameterSpec(keylen);
MessageDigest md;
try {
md = MessageDigest.getInstance("MD5");
md.update(passphrase.getBytes(getCharset()));
SecretKeySpec skeySpec ... | 1 |
[CLS] public static String getDigestResponse(String user, String password, String method, String requri, String authstr) {
String realm = "";
String nonce = "";
String opaque = "";
String algorithm = "";
String qop = "";
StringBuffer digest = new StringBuffer();
S... | 0 |
[CLS] public static void copyFile(File from, File to) throws IOException {
FileInputStream in = new FileInputStream(from);
FileOutputStream out = new FileOutputStream(to);
int c;
while ((c = in.read()) != -1) out.write(c);
in.close();
out.close();
} [SEP] private void... | 1 |
[CLS] public static void fileCopy(File sourceFile, File destFile) throws IOException {
FileChannel source = null;
FileChannel destination = null;
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream(sourceFile);
fos = ne... | 0 |
[CLS] private void putAlgosFromJar(File jarfile, AlgoDir dir, Model model) throws FileNotFoundException, IOException {
URLClassLoader urlLoader = new URLClassLoader(new URL[] { jarfile.toURI().toURL() });
JarInputStream jis = new JarInputStream(new FileInputStream(jarfile));
JarEntry entry = jis... | 1 |
[CLS] @Test
public void testFromFile() throws IOException {
File temp = File.createTempFile("fannj_", ".tmp");
temp.deleteOnExit();
IOUtils.copy(this.getClass().getResourceAsStream("xor_float.net"), new FileOutputStream(temp));
Fann fann = new Fann(temp.getPath());
assertEqua... | 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;
... | 1 |
[CLS] protected byte[] readGZippedBytes(TupleInput in) {
final boolean is_compressed = in.readBoolean();
byte array[] = readBytes(in);
if (array == null) return null;
if (!is_compressed) {
return array;
}
try {
ByteArrayInputStream bais = new ByteA... | 0 |
[CLS] private void process(int optind, String args[]) throws IOException, XMLStreamException {
final int srlimit = 500;
final QName att_title = new QName("title");
final QName att_sroffset = new QName("sroffset");
String sroffset = null;
String srnamespace = null;
if (!th... | 0 |
[CLS] public static void main(String[] argv) {
if (1 < argv.length) {
File[] sources = Source(argv[0]);
if (null != sources) {
for (File src : sources) {
File[] targets = Target(src, argv);
if (null != targets) {
... | 1 |
[CLS] protected List<Datastream> getDatastreams(final DepositCollection pDeposit) throws IOException, SWORDException {
List<Datastream> tDatastreams = new ArrayList<Datastream>();
LOG.debug("copying file");
String tZipTempFileName = super.getTempDir() + "uploaded-file.tmp";
IOUtils.copy(... | 0 |
[CLS] public static File getFileFromURL(URL url) {
File tempFile;
BufferedInputStream in = null;
BufferedOutputStream out = null;
try {
String tempDir = System.getProperty("java.io.tmpdir", ".");
tempFile = File.createTempFile("xxindex", ".tmp", new File(tempDir))... | 0 |
[CLS] private void setup() {
env = new EnvAdvanced();
try {
URL url = Sysutil.getURL("world.env");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while ((line = br.readLine()) != null) {
String... | 1 |
[CLS] public File createWindow(String pdfUrl) {
URL url;
InputStream is;
try {
int fileLength = 0;
String str;
if (pdfUrl.startsWith("jar:/")) {
str = "file.pdf";
is = this.getClass().getResourceAsStream(pdfUrl.substring(4));
... | 0 |
[CLS] public static boolean insert(final Funcionario objFuncionario) {
int result = 0;
final Connection c = DBConnection.getConnection();
PreparedStatement pst = null;
if (c == null) {
return false;
}
try {
c.setAutoCommit(false);
final... | 0 |
[CLS] private void criarQuestaoMultiplaEscolha(QuestaoMultiplaEscolha q) throws SQLException {
PreparedStatement stmt = null;
String sql = "INSERT INTO multipla_escolha (id_questao, texto, gabarito) VALUES (?,?,?)";
try {
for (Alternativa alternativa : q.getAlternativa()) {
... | 1 |
[CLS] public void run() {
try {
if (netLoadAccount.loginsuccessful) {
host = netLoadAccount.username + " | Netload.in";
} else {
host = "Netload.in";
}
status = UploadStatus.INITIALISING;
initialize();
HttpCl... | 0 |
[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] 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 ProductListByCatHandler(int cathegory, int langId) {
try {
URL url = new URL("http://eiffel.itba.edu.ar/hci/service/Catalog.groovy?method=GetProductListByCategory&category_id=" + cathegory + "&language_id=" + langId);
URLConnection urlc = url.openConnection();
ur... | 0 |
[CLS] private void copy(File from, File to) throws IOException {
InputStream in = new FileInputStream(from);
OutputStream out = new FileOutputStream(to);
byte[] line = new byte[16384];
int bytes = -1;
while ((bytes = in.read(line)) != -1) out.write(line, 0, bytes);
in.clo... | 0 |
[CLS] public void writeConfigurationFile() throws IOException, ComponentException {
SystemConfig config = parent.getParentSystem().getConfiguration();
File original = config.getLocation();
File backup = new File(original.getParentFile(), original.getName() + "." + System.currentTimeMillis());
... | 1 |
[CLS] public void login(String UID, String PWD, int CTY) throws Exception {
sSideURL = sSideURLCollection[CTY];
sUID = UID;
sPWD = PWD;
iCTY = CTY;
sLoginLabel = getLoginLabel(sSideURL);
String sParams = getLoginParams();
CookieHandler.setDefault(new ListCookieHan... | 0 |
[CLS] @Test
public void testTrainingDefault() throws IOException {
File temp = File.createTempFile("fannj_", ".tmp");
temp.deleteOnExit();
IOUtils.copy(this.getClass().getResourceAsStream("xor.data"), new FileOutputStream(temp));
List<Layer> layers = new ArrayList<Layer>();
l... | 0 |
[CLS] public void processSaveCompany(Company companyBean, AuthSession authSession) {
if (authSession == null) {
return;
}
DatabaseAdapter dbDyn = null;
PreparedStatement ps = null;
try {
dbDyn = DatabaseAdapter.getInstance();
String sql = "UPDA... | 1 |
[CLS] public static void copyFile(String source, String dest) throws IOException {
FileChannel in = null, out = null;
try {
in = new FileInputStream(new File(source)).getChannel();
out = new FileOutputStream(new File(dest)).getChannel();
in.transferTo(0, in.size(), ou... | 1 |
[CLS] public static String encryptMD5(String str) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(str.getBytes());
byte[] hash = md5.digest();
md5.reset();
return Format.hashToHex(hash);
} catch (java.security.NoSuchAlg... | 1 |
[CLS] public void copyFileFromLocalMachineToRemoteMachine(InputStream source, File destination) throws Exception {
String fileName = destination.getPath();
File f = new File(getFtpServerHome(), "" + System.currentTimeMillis());
f.deleteOnExit();
org.apache.commons.io.IOUtils.copy(source,... | 0 |
[CLS] public ProcessorOutput createOutput(String name) {
ProcessorOutput output = new ProcessorImpl.CacheableTransformerOutputImpl(getClass(), name) {
protected void readImpl(org.orbeon.oxf.pipeline.api.PipelineContext context, final ContentHandler contentHandler) {
ProcessorInput i... | 0 |
[CLS] public static ArrayList<Credential> importCredentials(String urlString) {
ArrayList<Credential> results = new ArrayList<Credential>();
try {
URL url = new URL(urlString);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
StringBuff... | 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 static File copyFile(File from, File to) throws IOException {
FileOutputStream fos = new FileOutputStream(to);
FileInputStream fis = new FileInputStream(from);
FileChannel foc = fos.getChannel();
FileChannel fic = fis.getChannel();
foc.transferFrom(fic, 0, fic.size()... | 1 |
[CLS] @Override
public void parse() throws IOException {
URL url = new URL(getDataUrl());
URLConnection con = url.openConnection();
BufferedReader bStream = new BufferedReader(new InputStreamReader(con.getInputStream()));
String s = bStream.readLine();
String[] tokens = s.spl... | 0 |
[CLS] private void initialize(Resource location) {
if (_log.isDebugEnabled()) _log.debug("loading messages from location: " + location);
String descriptorName = location.getName();
int dotx = descriptorName.lastIndexOf('.');
String baseName = descriptorName.substring(0, dotx);
St... | 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... | 0 |
[CLS] public boolean backupFile(File oldFile, File newFile) {
boolean isBkupFileOK = false;
FileChannel sourceChannel = null;
FileChannel targetChannel = null;
try {
sourceChannel = new FileInputStream(oldFile).getChannel();
targetChannel = new FileOutputStream(ne... | 1 |
[CLS] public void testCreate() throws Exception {
File f = File.createTempFile("DiskCacheItemTest", "tmp");
f.deleteOnExit();
try {
DiskCacheItem i = new DiskCacheItem(f);
i.setLastModified(200005L);
i.setTranslationCount(11);
i.setEncoding("GB2312... | 1 |
[CLS] private Document getDocument(URL url) throws SAXException, IOException {
InputStream is;
try {
is = url.openStream();
} catch (IOException io) {
System.out.println("parameter error : The specified reading data is mistaken.");
System.out.println(" Request... | 0 |
[CLS] public RFC1345List(URL url) {
if (url == null) return;
try {
BufferedReader br = new BufferedReader(new InputStreamReader(new GZIPInputStream(url.openStream())));
final String linePattern = " XX??????? HHHH X";
String line;
mnemos = new HashM... | 0 |
[CLS] public static void copyWithClose(InputStream is, OutputStream os) throws IOException {
try {
IOUtils.copy(is, os);
} catch (IOException ioe) {
try {
if (os != null) os.close();
} catch (Exception e) {
}
try {
... | 1 |
[CLS] private HashSet<String> href(String urlstr) throws IOException {
HashSet<String> hrefs = new HashSet<String>();
URL url = new URL(urlstr);
URLConnection con = url.openConnection();
con.setRequestProperty("Cookie", "_session_id=" + _session_id);
InputStreamReader r = new Inp... | 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... | 0 |
[CLS] public String decrypt(String text, String passphrase, int keylen) {
RC2ParameterSpec parm = new RC2ParameterSpec(keylen);
MessageDigest md;
try {
md = MessageDigest.getInstance("MD5");
md.update(passphrase.getBytes(getCharset()));
SecretKeySpec skeySpec ... | 0 |
[CLS] public void configureLogging() {
try {
PreferenceStore preferences = new PreferenceStore();
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry.getExtensionPoint(CorePlugin.LOGGER_PREFERENCES_EXTENSION_POINT);
... | 0 |
[CLS] public void run() {
saveWLHome();
for (final TabControl control : tabControls) {
control.performOk(WLPropertyPage.this.getProject(), WLPropertyPage.this);
}
if (isEnabledJCLCopy()) {
final File url = new File(W... | 1 |
[CLS] public boolean copy(File src, File dest, byte[] b) {
if (src.isDirectory()) {
String[] ss = src.list();
for (int i = 0; i < ss.length; i++) if (!copy(new File(src, ss[i]), new File(dest, ss[i]), b)) return false;
return true;
}
delete(dest);
dest... | 1 |
[CLS] public boolean checkConnection() {
int tries = 3;
for (int i = 0; i < tries; i++) {
try {
final URL url = new URL(wsURL);
final URLConnection conn = url.openConnection();
conn.setReadTimeout(3000);
conn.getContent();
... | 0 |
[CLS] private IProject createCopyProject(IProject project, IWorkspace ws, IProgressMonitor pm) throws CoreException {
pm.beginTask("Creating temp project", 1);
final String pName = "translation_" + project.getName() + "_" + new Date().toString().replace(" ", "_").replace(":", "_");
final IProgre... | 0 |
[CLS] private DataSource loadSingleDataSource(ClassLoader contextLoader, URL url) throws IOException, DataSourceException {
URI datasourceURI;
OWLOntology datasourceOntology = null;
URL baseURL = new URL(url.toString().replace("META-INF/artifact.properties", ""));
Properties properties =... | 0 |
[CLS] public static void copyFile6(File srcFile, File destFile) throws FileNotFoundException {
Scanner s = new Scanner(srcFile);
PrintWriter pw = new PrintWriter(destFile);
while(s.hasNextLine()) {
pw.println(s.nextLine());
}
pw.close();
s.close();
} [SEP] @ActionMethod
public void download() throws... | 0 |
[CLS] public static List importSymbols(List symbols) throws ImportExportException {
List quotes = new ArrayList();
String URLString = constructURL(symbols);
IDQuoteFilter filter = new YahooIDQuoteFilter();
PreferencesManager.ProxyPreferences proxyPreferences = PreferencesManager.loadProx... | 0 |
[CLS] public static int executeUpdate(EOAdaptorChannel channel, String sql, boolean autoCommit) throws SQLException {
int rowsUpdated;
boolean wasOpen = channel.isOpen();
if (!wasOpen) {
channel.openChannel();
}
Connection conn = ((JDBCContext) channel.adaptorContext(... | 0 |
[CLS] private File sendQuery(String query) throws MusicBrainzException {
File xmlServerResponse = null;
try {
xmlServerResponse = new File(SERVER_RESPONSE_FILE);
long start = Calendar.getInstance().getTimeInMillis();
System.out.println("\n\n+++++++++++++++++++++++++++... | 1 |
[CLS] public void writeToFile(File file, File source) throws IOException {
BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(file));
BufferedInputStream bin = new BufferedInputStream(new FileInputStream(source));
bin.skip(header.getHeaderEndingOffset());
for (long... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.