text string | label int64 |
|---|---|
[CLS] private void calculateCoverageAndSpecificity(String mainCat) throws IOException, JSONException {
for (String cat : Rules.categoryTree.get(mainCat)) {
for (String queryString : Rules.queries.get(cat)) {
String urlEncodedQueryString = URLEncoder.encode(queryString, "UTF-8");
... | 0 |
[CLS] protected void copyFile(File from, File to) throws IOException {
to.getParentFile().mkdirs();
InputStream in = new FileInputStream(from);
try {
OutputStream out = new FileOutputStream(to);
try {
byte[] buf = new byte[1024];
int readLe... | 0 |
[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 str;
while ((str = bStream.readLine()) != null)... | 0 |
[CLS] public void service(Request req, Response resp) {
PrintStream out = null;
try {
out = resp.getPrintStream(8192);
String env = req.getParameter("env");
String regex = req.getParameter("regex");
String deep = req.getParameter("deep");
Strin... | 1 |
[CLS] public void bspMain(BSP bsp, Serializable arg) throws AbortedException {
if (!(arg instanceof String[])) {
bsp.abort(new RuntimeException("String[] as arguments expected"));
}
String[] args = (String[]) arg;
long t1 = 0L, t2;
try {
if (bsp != null) b... | 0 |
[CLS] public void write(File file) throws Exception {
if (isInMemory()) {
FileOutputStream fout = null;
try {
fout = new FileOutputStream(file);
fout.write(get());
} finally {
if (fout != null) {
fout.close()... | 1 |
[CLS] private ByteBuffer getByteBuffer(String resource) throws IOException {
ClassLoader classLoader = this.getClass().getClassLoader();
InputStream in = classLoader.getResourceAsStream(resource);
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtils.copy(in, out);
ret... | 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... | 1 |
[CLS] public void setImage(String imageUrl) {
try {
InputStream url = ProjectManager.getCurrentProject().getUrl(imageUrl).openStream();
Image im = new Image(getDisplay(), url);
if (im != null) setImage(im);
} catch (IOException e) {
e.printStackTrace();
... | 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 {
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOExc... | 0 |
[CLS] private void copyFile(String sourceFilename, String destDirname) throws BuildException {
log("Copying file " + sourceFilename + " to " + destDirname);
File destFile = getDestFile(sourceFilename, destDirname);
InputStream inStream = null;
OutputStream outStream = null;
try {... | 1 |
[CLS] public List tree(String cat, int branch) {
Pattern p = Pattern.compile("<a href=\"javascript:checkBranch\\(([0-9]+), 'true'\\)\">([^<]*)</a>");
Matcher m;
List res = new ArrayList();
URL url;
HttpURLConnection conn;
System.out.println();
try {
ur... | 0 |
[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] public static String encryptPassword(String password) {
try {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(password.getBytes());
byte[] hash = md.digest();
int hashLength = hash.length;
StringBuffer hashStringBuf = new StringBuf... | 1 |
[CLS] public File copyFile(File f) throws IOException {
File t = createNewFile("fm", "cpy");
FileOutputStream fos = new FileOutputStream(t);
FileChannel foc = fos.getChannel();
FileInputStream fis = new FileInputStream(f);
FileChannel fic = fis.getChannel();
foc.transferF... | 1 |
[CLS] public static void main(String[] args) {
String host;
int port;
char[] passphrase;
System.out.println("InstallCert - Install CA certificate to Java Keystore");
System.out.println("=====================================================");
final BufferedReader reader =... | 1 |
[CLS] public URI normalize(final URI uri) {
URI normalizedUri = super.normalize(uri);
if (normalizedUri.equals(uri)) {
String resourceName = uri.toString().replaceAll(".*(\\\\+|/)", "");
if (!containsNormalizedUriKey(uri)) {
for (Iterator<Path> iterator = this.ite... | 0 |
[CLS] private boolean authenticate(String reply) {
String user = reply.substring(0, reply.indexOf(" "));
String resp = reply.substring(reply.indexOf(" ") + 1);
if (!module.users.contains(user)) {
error = "so such user " + user;
return false;
}
try {
... | 1 |
[CLS] public void delete(int id) throws FidoDatabaseException {
try {
Connection conn = null;
Statement stmt = null;
try {
conn = fido.util.FidoDataSource.getConnection();
conn.setAutoCommit(false);
stmt = conn.createStatement()... | 0 |
[CLS] public void elimina(Cliente cli) throws errorSQL, errorConexionBD {
System.out.println("GestorCliente.elimina()");
int id = cli.getId();
String sql;
Statement stmt = null;
try {
gd.begin();
sql = "DELETE FROM cliente WHERE cod_cliente = '" + id + "'"... | 0 |
[CLS] public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
Git git = Git.getCurrent(req.getSession());
GitComponentReader gitReader = git.getComponentReader("warpinjector");
String id = req.getParameter("id");
GitElement element = gi... | 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] public static String generateSHA1Digest(String text) {
try {
MessageDigest md;
md = MessageDigest.getInstance("SHA-1");
byte[] sha1hash = new byte[40];
md.update(text.getBytes("UTF-8"), 0, text.length());
sha1hash = md.digest();
retur... | 1 |
[CLS] public AudioInputStream getAudioInputStream(URL url, String userAgent) throws UnsupportedAudioFileException, IOException {
if (TDebug.TraceAudioFileReader) {
TDebug.out("MpegAudioFileReaderWorkaround.getAudioInputStream(URL,String): begin");
}
long lFileLengthInBytes = AudioSys... | 0 |
[CLS] public void SendFile(File testfile) {
try {
SocketChannel sock = SocketChannel.open(new InetSocketAddress("127.0.0.1", 1234));
sock.configureBlocking(true);
while (!sock.finishConnect()) {
System.out.println("NOT connected!");
}
S... | 1 |
[CLS] public static String md5Hash(String inString) throws TopicSpacesException {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(inString.getBytes());
byte[] array = md5.digest();
StringBuffer buf = new StringBuffer();
int len =... | 1 |
[CLS] public static boolean isSameHttpContent(final String url, final File localFile, UsernamePasswordCredentials creds) throws IOException {
if (localFile.isFile()) {
long localContentLength = localFile.length();
long localLastModified = localFile.lastModified() / 1000;
long... | 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;... | 1 |
[CLS] public File addFile(File file, String suffix) throws IOException {
if (file.exists() && file.isFile()) {
File nf = File.createTempFile(prefix, "." + suffix, workdir);
nf.delete();
if (!file.renameTo(nf)) {
IOUtils.copy(file, nf);
}
... | 0 |
[CLS] @Test
public void testWriteAndRead() throws Exception {
JCFSFileServer server = new JCFSFileServer(defaultTcpPort, defaultTcpAddress, defaultUdpPort, defaultUdpAddress, dir, 0, 0);
JCFS.configureDiscovery(defaultUdpAddress, defaultUdpPort);
try {
server.start();
... | 0 |
[CLS] private void _resetLanguages(ActionRequest req, ActionResponse res, PortletConfig config, ActionForm form) throws Exception {
List list = (List) req.getAttribute(WebKeys.LANGUAGE_MANAGER_LIST);
for (int i = 0; i < list.size(); i++) {
long langId = ((Language) list.get(i)).getId();
... | 0 |
[CLS] public String getData() throws ValueFormatException, RepositoryException, IOException {
InputStream is = getStream();
StringWriter sw = new StringWriter();
IOUtils.copy(is, sw, "UTF-8");
IOUtils.closeQuietly(is);
return sw.toString();
} [SEP] public static void copy(Fil... | 1 |
[CLS] public void write(HttpServletRequest req, HttpServletResponse res, Object bean) throws IntrospectionException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, IOException {
res.setContentType(contentType);
final Object r;
if (HttpRpcServer.HttpRpcOutput.class.isAs... | 1 |
[CLS] static Collection<InetSocketAddress> getAddresses(Context ctx, long userId) throws Exception {
AGLog.d(TAG, "Connecting to HTTP service to obtain IP addresses");
String host = (String) ctx.getResources().getText(R.string.gg_webservice_addr);
String ver = App.getInstance().getGGClientVersio... | 0 |
[CLS] public final void provisionGSLAM() {
try {
UUID[] slaUUID = new UUID[] { new UUID("AG-1") };
SLA[] slas = sslamContext.getSLARegistry().getIQuery().getSLA(slaUUID);
for (SLA s : slas) {
Party[] parties = s.getParties();
System.out.println... | 0 |
[CLS] public static String getMD5Str(String str) {
MessageDigest messageDigest = null;
try {
messageDigest = MessageDigest.getInstance("MD5");
messageDigest.reset();
messageDigest.update(str.getBytes("UTF-8"));
} catch (NoSuchAlgorithmException e) {
... | 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] public static Hashtable DefaultLoginValues(String firstName, String lastName, String password, String mac, String startLocation, int major, int minor, int patch, int build, String platform, String viewerDigest, String userAgent, String author) throws Exception {
Hashtable values = new Hashtable();
... | 1 |
[CLS] public XmldbURI createFile(String newName, InputStream is, Long length, String contentType) throws IOException, PermissionDeniedException, CollectionDoesNotExistException {
if (LOG.isDebugEnabled()) LOG.debug("Create '" + newName + "' in '" + xmldbUri + "'");
XmldbURI newNameUri = XmldbURI.create(... | 1 |
[CLS] @Override
public boolean putUserDescription(String openID, String uuid, String description) throws DatabaseException {
if (uuid == null) throw new NullPointerException("uuid");
if (description == null) throw new NullPointerException("description");
try {
getConnection().set... | 1 |
[CLS] public boolean chequearMarca(int a, int m, int d) {
boolean existe = false;
try {
cantidadArchivos = obtenerCantidad() + 1;
String filenametxt = "";
String filenamezip = "";
int dia = 0;
int mes = 0;
int ano = 0;
f... | 1 |
[CLS] @Override
public void run() {
try {
File[] inputFiles = new File[this.previousFiles != null ? this.previousFiles.length + 1 : 1];
File copiedInput = new File(this.randomFolder, this.inputFile.getName());
IOUtils.copyFile(this.inputFile, copiedInput);
inp... | 0 |
[CLS] @Override
public String addUserIdentity(OpenIDItem identity, long userId) throws DatabaseException {
if (identity == null) throw new NullPointerException("identity");
if (identity.getIdentity() == null || "".equals(identity.getIdentity())) throw new NullPointerException("identity.getIdentity()... | 0 |
[CLS] private void packageDestZip(File tmpFile) throws FileNotFoundException, IOException {
log("Creating launch profile package " + destfile);
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(destfile)));
ZipEntry e = new ZipEntry(RESOURCE_JAR_FILENAME);
... | 0 |
[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 byte[] readUrl(URL url) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
InputStream is = url.openStream();
try {
IOUtils.copy(is, os);
return os.toByteArray();
} finally {
is.close();
}
} [SE... | 0 |
[CLS] public String getWeather(String cityName, String fileAddr) {
try {
URL url = new URL("http://www.google.com/ig/api?hl=zh_cn&weather=" + cityName);
InputStream inputstream = url.openStream();
String s, str;
BufferedReader in = new BufferedReader(new InputStre... | 0 |
[CLS] public void download(String ftpServer, String user, String password, String fileName, File destination) throws MalformedURLException, IOException {
if (ftpServer != null && fileName != null && destination != null) {
StringBuffer sb = new StringBuffer("ftp://");
if (user != null && ... | 0 |
[CLS] public static boolean copyFile(File from, File tu) {
final int BUFFER_SIZE = 4096;
byte[] buffer = new byte[BUFFER_SIZE];
try {
FileInputStream in = new FileInputStream(from);
FileOutputStream out = new FileOutputStream(tu);
int read;
while (... | 0 |
[CLS] public static void copyFile(File source, File target) throws Exception {
if (source.isDirectory()) {
if (!target.isDirectory()) {
target.mkdirs();
}
String[] children = source.list();
for (int i = 0; i < children.length; i++) {
... | 1 |
[CLS] public static byte[] readFile(String filePath) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
FileInputStream is = new FileInputStream(filePath);
try {
IOUtils.copy(is, os);
return os.toByteArray();
} finally {
is.cl... | 1 |
[CLS] private static JvUndoableTableModel CSVReader(String filepath) throws IOException {
try {
URI url = new URI(filepath);
return CSVReader(url.toURL().openStream());
} catch (URISyntaxException ex) {
File file = new File(filepath);
return CSVReader(file... | 0 |
[CLS] public File getFile(String file) {
DirProperties dp;
List files = new ArrayList();
for (int i = 0; i < locs.size(); i++) {
dp = (DirProperties) locs.get(i);
if (dp.isReadable()) {
File g = new File(dp.getLocation() + slash() + file);
... | 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 {
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOExc... | 1 |
[CLS] public static int zipFile(File file_input, File dir_output) {
File zip_output = new File(dir_output, file_input.getName() + ".zip");
ZipOutputStream zip_out_stream;
try {
FileOutputStream out = new FileOutputStream(zip_output);
zip_out_stream = new ZipOutputStream(n... | 1 |
[CLS] public static void copyFile(File in, File out) {
int len;
byte[] buffer = new byte[1024];
try {
FileInputStream fin = new FileInputStream(in);
FileOutputStream fout = new FileOutputStream(out);
while ((len = fin.read(buffer)) >= 0) fout.write(buffer, 0, ... | 1 |
[CLS] private void doLogin(String password) throws LoginFailedException, IncorrectPasswordException {
final long mgr = Constants.MANAGER;
Data data, response;
try {
response = sendAndWait(new Request(mgr)).get(0);
MessageDigest md;
try {
md = M... | 1 |
[CLS] protected void checkWeavingJar() throws IOException {
OutputStream out = null;
try {
final File weaving = new File(getWeavingPath());
if (!weaving.exists()) {
new File(getWeavingFolder()).mkdir();
weaving.createNewFile();
fina... | 1 |
[CLS] public static boolean isAnimated(Icon icon) {
if (icon instanceof ImageIcon) {
Image image = ((ImageIcon) icon).getImage();
if (image != null) {
Object comment = image.getProperty("comment", null);
if (String.valueOf(comment).startsWith("GifBuilder")... | 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();
... | 1 |
[CLS] static void conditionalCopyFile(File dst, File src) throws IOException {
if (dst.equals(src)) return;
if (!dst.isFile() || dst.lastModified() < src.lastModified()) {
System.out.println("Copying " + src);
InputStream is = new FileInputStream(src);
OutputStream os... | 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] @Override
public void dispatchContent(InputStream is) throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("Sending content message over JMS");
}
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
IOUtils.copy(is, bos);
this.send(new Messag... | 1 |
[CLS] private static void includePodDependencies(Curnit curnit, JarOutputStream jarout) throws IOException {
Properties props = new Properties();
Collection<Pod> pods = curnit.getReferencedPods();
for (Pod pod : pods) {
PodUuid podId = pod.getPodId();
URL weburl = PodArch... | 1 |
[CLS] public static void main(String[] args) throws IOException {
InputStream stream = null;
FileOutputStream fos = null;
File in = new File("in.txt");
try {
URL url = new URL(args[0]);
stream = url.openStream();
fos = new FileOutputStream(in);
... | 0 |
[CLS] public Stopper(String stopWordsFile) {
try {
BufferedReader br = null;
FileReader fr = null;
if (stopWordsFile.startsWith("http")) {
URL url = new URL(stopWordsFile);
br = new BufferedReader(new InputStreamReader(url.openStream()));
... | 0 |
[CLS] public static String MD5ToString(String md5) {
String hashword = null;
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(md5.getBytes());
BigInteger hash = new BigInteger(1, md.digest());
hashword = hash.toString(16);
} cat... | 1 |
[CLS] public static Document getDocument(String string, String defaultCharset) {
DOMParser parser = new DOMParser();
try {
URL url = new URL(string);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setConnectTimeout(10000);
con.setUse... | 0 |
[CLS] public void importarBancoDeDadosDARI(File pArquivoXLS, Andamento pAndamento) throws IOException, SQLException, InvalidFormatException {
final String ABA_VALOR_DE_MERCADO = "Valor de Mercado";
final int COLUNA_DATA = 1, COLUNA_ANO = 6, COLUNA_VALOR_DE_MERCADO_DIARIO_EM_BILHOES_DE_REAIS = 2, COLUNA_... | 1 |
[CLS] public RecordIterator(URL fileUrl, ModelDataFile modelDataFile) throws DataFileException {
this.modelDataFile = modelDataFile;
InputStream urlStream = null;
try {
urlStream = fileUrl.openStream();
} catch (IOException e) {
throw new DataFileException("Error ... | 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... | 1 |
[CLS] public static final synchronized String hash(String data) {
if (digest == null) {
try {
digest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException nsae) {
System.err.println("Failed to load the MD5 MessageDigest. " + "We will be una... | 1 |
[CLS] public void genCreateSchema(DiagramModel diagramModel, String source) {
try {
con.setAutoCommit(false);
stmt = con.createStatement();
Collection boxes = diagramModel.getBoxes();
BoxModel box;
ItemModel item;
String sqlQuery;
... | 0 |
[CLS] private void handleUpload(CommonsMultipartFile file, String newFileName, String uploadDir) throws IOException, FileNotFoundException {
File dirPath = new File(uploadDir);
if (!dirPath.exists()) {
dirPath.mkdirs();
}
InputStream stream = file.getInputStream();
Ou... | 1 |
[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] @Override
public void execute(JobExecutionContext context) throws JobExecutionException {
super.execute(context);
debug("Start execute job " + this.getClass().getName());
try {
String name = "nixspam-ip.dump.gz";
String f = this.path_app_root + "/" + this.proper... | 0 |
[CLS] private static String getWebPage(String urlString) throws Exception {
URL url;
HttpURLConnection conn;
BufferedReader rd;
String line;
StringBuilder result = new StringBuilder();
try {
url = new URL(urlString);
conn = (HttpURLConnection) url.... | 0 |
[CLS] private void createSoundbank(String testSoundbankFileName) throws Exception {
System.out.println("Create soundbank");
File packageDir = new File("testsoundbank");
if (packageDir.exists()) {
for (File file : packageDir.listFiles()) assertTrue(file.delete());
assertTr... | 0 |
[CLS] public static String getBiopaxId(Reaction reaction) {
String id = null;
if (reaction.getId() > Reaction.NO_ID_ASSIGNED) {
id = reaction.getId().toString();
} else {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(... | 1 |
[CLS] public void loginMD5() throws Exception {
GetMethod get = new GetMethod("http://login.yahoo.com/config/login?.src=www&.done=http://www.yahoo.com");
get.setRequestHeader("user-agent", "Mozilla/5.0 (Macintosh; U; PPC MacOS X; en-us) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1");
client.... | 1 |
[CLS] public void initializeWebInfo() throws MalformedURLException, IOException, DOMException {
Tidy tidy = new Tidy();
URL url = new URL(YOUTUBE_URL + videoId);
InputStream in = url.openConnection().getInputStream();
Document doc = tidy.parseDOM(in, null);
Element e = doc.getDoc... | 0 |
[CLS] public void actionPerformed(ActionEvent evt) {
try {
File tempFile = new File("/tmp/controler.xml");
File f = new File("/tmp/controler-temp.xml");
BufferedInputStream copySource = new BufferedInputStream(new FileInputStream(tempFile));
Bu... | 0 |
[CLS] public static void fileCopy(String from_name, String to_name) throws IOException {
File fromFile = new File(from_name);
File toFile = new File(to_name);
if (fromFile.equals(toFile)) abort("cannot copy on itself: " + from_name);
if (!fromFile.exists()) abort("no such currentSourcepa... | 1 |
[CLS] @Override
public InputStream openStream(long off, long len) throws IOException {
URLConnection con = url.openConnection();
if (!(con instanceof HttpURLConnection)) {
return null;
}
long t0 = System.currentTimeMillis();
HttpURLConnection urlcon = (HttpURLConn... | 0 |
[CLS] private void copyLocalFile(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] private void innerJob(String inFrom, String inTo, String line, Map<String, Match> result) throws UnsupportedEncodingException, IOException {
String subline = line.substring(line.indexOf(inTo) + inTo.length());
String tempStr = subline.substring(subline.indexOf(inFrom) + inFrom.length(), subline.in... | 1 |
[CLS] static void invalidSlave(String msg, Socket sock) throws IOException {
BufferedReader _sinp = null;
PrintWriter _sout = null;
try {
_sout = new PrintWriter(sock.getOutputStream(), true);
_sinp = new BufferedReader(new InputStreamReader(sock.getInputStream()));
... | 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 |
[CLS] private byte[] getBytes(String resource) throws IOException {
InputStream is = HttpServletFileDownloadTest.class.getResourceAsStream(resource);
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtils.copy(is, out);
IOUtils.closeQuietly(is);
return out.toByteArray()... | 0 |
[CLS] private static void processFile(StreamDriver driver, String sourceName) throws Exception {
String destName = sourceName + ".xml";
File dest = new File(destName);
if (dest.exists()) {
throw new IllegalArgumentException("File '" + destName + "' already exists!");
}
... | 0 |
[CLS] public int addPermissionsForUserAndAgenda(Integer userId, Integer agendaId, String permissions) throws TechnicalException {
if (permissions == null) {
throw new TechnicalException(new Exception(new Exception("Column 'permissions' cannot be null")));
}
Session session = null;
... | 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... | 0 |
[CLS] private static ISimpleChemObjectReader createReader(URL url, String urlString, String type) throws CDKException {
if (type == null) {
type = "mol";
}
ISimpleChemObjectReader cor = null;
cor = new MDLV2000Reader(getReader(url), Mode.RELAXED);
try {
Re... | 0 |
[CLS] public void testReaderWriterUC2() throws Exception {
String inFile = "test_data/mri.png";
String outFile = "test_output/mri__smooth_testReaderWriter.png";
itkImageFileReaderUC2_Pointer reader = itkImageFileReaderUC2.itkImageFileReaderUC2_New();
itkImageFileWriterUC2_Pointer writer ... | 1 |
[CLS] public String getMd5CodeOf16(String str) {
StringBuffer buf = null;
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(str.getBytes());
byte b[] = md.digest();
int i;
buf = new StringBuffer("");
for (int offs... | 1 |
[CLS] public static void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException {
log.debug("Start MemberPortletActionMethod.processAction()");
MemberProcessingActionRequest mp = null;
try {
ModuleManager moduleManager = ModuleManager.getIns... | 1 |
[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] public void run() throws Exception {
logger.debug("#run enter");
PreparedStatement ps = null;
try {
connection.setAutoCommit(false);
ps = connection.prepareStatement(SQL_UPDATE_ITEM_MIN_QTTY);
ps.setInt(1, deliveryId);
ps.setInt(2, deliveryId... | 1 |
[CLS] protected InputSource getInputSource(String pReferencingSystemId, String pURI) throws SAXException {
URL url = null;
if (pReferencingSystemId != null) {
try {
url = new URL(new URL(pReferencingSystemId), pURI);
} catch (MalformedURLException e) {
... | 0 |
[CLS] public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException {
String name = metadata.get(Metadata.RESOURCE_NAME_KEY);
if (name != null && wanted.containsKey(name)) {
FileOutputStream out = new Fi... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.