text string | label int64 |
|---|---|
[CLS] private void createPropertyName(String objectID, String value, String propertyName, Long userID) throws JspTagException {
rObject object = new rObject(new Long(objectID), userID);
ClassProperty classProperty = new ClassProperty(propertyName, object.getClassName());
String newValue = value;... | 0 |
[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 {
... | 0 |
[CLS] public static BufferedReader getReader(int license) {
URL url = getResource(license);
if (url == null) return null;
InputStream inStream;
try {
inStream = url.openStream();
} catch (IOException e) {
return null;
}
return new BufferedR... | 0 |
[CLS] public void unzip(final File outDir) throws IOException {
ZipInputStream input = new ZipInputStream(new ByteArrayInputStream(this.bytes));
ZipEntry entry = input.getNextEntry();
while (entry != null) {
entry = input.getNextEntry();
if (entry != null) {
... | 1 |
[CLS] public void restoreDrivers() throws ExplorerException {
try {
drivers.clear();
URL url = URLUtil.getResourceURL("default_drivers.xml");
loadDefaultDrivers(url.openStream());
} catch (IOException e) {
throw new ExplorerException(e);
}
} [S... | 0 |
[CLS] private static String getDigestPassword(String streamId, String password) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
throw (RuntimeException) new IllegalStateException().initCause(e);
}
... | 0 |
[CLS] public List<Class<?>> getImplementingClasses(Class<?> ancestor, boolean searchAllClasspath) throws MutableClassLoaderException {
List<Class<?>> classes = new LinkedList<Class<?>>();
for (URL url : (searchAllClasspath ? getURLs() : getAddedURLs())) {
Log.verbose("Checking classpath item... | 0 |
[CLS] public boolean verify(String digest, String password) throws NoSuchAlgorithmException {
String alg = null;
int size = 0;
if (digest.regionMatches(true, 0, "{CRYPT}", 0, 7)) {
digest = digest.substring(7);
return UnixCrypt.matches(digest, password);
} else if... | 0 |
[CLS] public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/html");
String year = req.getParameter("year").toString();
String round = req.getParameter("round").toString();
resp.getWriter().println("<html><body>");
resp... | 0 |
[CLS] public static <T extends Comparable<T>> void BubbleSortComparable1(T[] num) {
int j;
boolean flag = true; // set flag to true to begin first pass
T temp; // holding variable
while (flag) {
flag = false; // set flag to false awaiting a possible swap
for (j = 0; j < num.length - 1; j++) {
if (num... | 0 |
[CLS] public static Map<String, File> extractFiles(String input, File tempDirectory) throws IOException {
byte data[] = new byte[BUFFER];
BufferedOutputStream out = null;
FileInputStream src = new FileInputStream(input);
BufferedInputStream in = new BufferedInputStream(src);
ZipI... | 1 |
[CLS] private void fileUpload() throws IOException {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(postURL);
if (zShareAccount.loginsuccessful) {
httppost.setHeader("Cookie", zShareAccount.getSidcookie() + ";" + zShareAccount.getMysessioncookie());... | 0 |
[CLS] public void prepareOutput(HttpServletRequest req) {
EaasyStreet.logTrace(METHOD_IN + className + OUTPUT_METHOD);
super.prepareOutput(req);
String content = Constants.EMPTY_STRING;
String rawContent = null;
List parts = null;
try {
URL url = new URL(sourc... | 1 |
[CLS] private String getMD5(String data) {
try {
MessageDigest md5Algorithm = MessageDigest.getInstance("MD5");
md5Algorithm.update(data.getBytes(), 0, data.length());
byte[] digest = md5Algorithm.digest();
StringBuffer hexString = new StringBuffer();
... | 0 |
[CLS] public static void copyFile(String source, String destination) throws IOException {
File srcDir = new File(source);
File[] files = srcDir.listFiles();
FileChannel in = null;
FileChannel out = null;
for (File file : files) {
try {
in = new FileInp... | 1 |
[CLS] public void print(PrintWriter out) {
out.println("<?xml version=\"1.0\"?>\n" + "<?xml-stylesheet type=\"text/xsl\" href=\"http://www.urbigene.com/foaf/foaf2html.xsl\" ?>\n" + "<rdf:RDF \n" + "xml:lang=\"en\" \n" + "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" \n" + "xmlns:rdfs=\"http://www.w... | 0 |
[CLS] public byte process(ProcessorContext<PublishRequest> context) throws InterruptedException, ProcessorException {
logger.info("MapTileChacheTask:process");
PublishRequest req = context.getItem().getEntity();
if (StringUtils.isEmpty(req.getBackMap())) return TaskState.STATE_TILE_CACHED;
... | 0 |
[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] public void configureLogging() {
try {
PreferenceStore preferences = new PreferenceStore();
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry.getExtensionPoint(CorePlugin.LOGGER_PREFERENCES_EXTENSION_POINT);
... | 0 |
[CLS] @Override
public void call(String soapAction, SoapEnvelope envelope) throws IOException, XmlPullParserException {
if (soapAction == null) {
soapAction = "\"\"";
}
byte[] requestData = createRequestData(envelope);
requestDump = debug ? new String(requestData) : null;... | 0 |
[CLS] public static boolean dumpFile(String from, File to, String lineBreak) {
try {
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(from)));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(to)));
String lin... | 1 |
[CLS] private static boolean prepareProbeFile(String completePath, String outputFile) {
try {
File inFile = new File(completePath + fSep + "probe.txt");
FileChannel inC = new FileInputStream(inFile).getChannel();
BufferedReader br = new BufferedReader(new FileReader(inFile));... | 1 |
[CLS] public static synchronized String hash(String data) {
if (digest == null) {
try {
digest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException nsae) {
}
}
try {
digest.update(data.getBytes("utf-8"));
} ... | 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] public void assign() throws Exception {
if (proposalIds.equals("") || usrIds.equals("")) throw new Exception("No proposal or peer-viewer selected.");
String[] pids = proposalIds.split(",");
String[] uids = usrIds.split(",");
int pnum = pids.length;
int unum = uids.length;
... | 0 |
[CLS] public static String SHA1(String string) throws XLWrapException {
MessageDigest md;
try {
md = MessageDigest.getInstance("SHA-1");
} catch (NoSuchAlgorithmException e) {
throw new XLWrapException("SHA-1 message digest is not available.");
}
byte[] da... | 0 |
[CLS] public boolean processFtp(String serverIp, int port, String user, String password, String synchrnPath, String filePath, File[] uploadFile) throws Exception {
boolean upload = false;
try {
FTPClient ftpClient = new FTPClient();
ftpClient.setControlEncoding("euc-kr");
... | 0 |
[CLS] private void copy(File from, File to) {
if (from.isDirectory()) {
File[] files = from.listFiles();
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory()) {
File newTo = new File(to.getPath() + File.separator + files[i].getName());
... | 1 |
[CLS] public List<BadassEntry> parse() {
mBadassEntries = new ArrayList<BadassEntry>();
try {
URL url = new URL(mUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setDoOutput(true)... | 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] 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] private void writeGif(String filename, String outputFile) throws IOException {
File file = new File(filename);
InputStream in = new FileInputStream(file);
FileOutputStream fout = new FileOutputStream(outputFile);
int totalRead = 0;
int readBytes = 0;
int blockSize =... | 1 |
[CLS] public static String MD5(String text) throws ProducteevSignatureException {
try {
MessageDigest md;
md = MessageDigest.getInstance(ALGORITHM);
byte[] md5hash;
md.update(text.getBytes("utf-8"), 0, text.length());
md5hash = md.digest();
... | 1 |
[CLS] private static boolean tryExpandGorillaHome(File f) throws GorillaHomeException {
if (f.exists()) {
if (!f.isDirectory() || !f.canWrite()) {
return false;
}
} else {
boolean dirOK = f.mkdirs();
}
if (f.exists() && f.isDirectory() ... | 0 |
[CLS] public final void build() {
if (!built_) {
built_ = true;
final boolean[] done = new boolean[] { false };
Runnable runnable = new Runnable() {
public void run() {
try {
exists_ = true;
... | 0 |
[CLS] public static String sendGetRequest(String endpoint, String requestParameters) {
String result = null;
if (endpoint.startsWith("http://")) {
try {
StringBuffer data = new StringBuffer();
String urlStr = endpoint;
if (requestParameters != ... | 0 |
[CLS] public static void copyFile(File source, File destination) throws IOException {
if (!source.isFile()) {
throw new IOException(source + " is not a file.");
}
if (destination.exists()) {
throw new IOException("Destination file " + destination + " is already exist.");
... | 0 |
[CLS] public String quebraLink(String link) throws StringIndexOutOfBoundsException {
link = link.replace(".url", "");
int cod = 0;
final String linkInit = link.replace("#", "");
boolean estado = false;
char letra;
String linkOrig;
String newlink = "";
link... | 0 |
[CLS] private void getViolationsReportByProductOfferIdYearMonth() throws IOException {
String xmlFile8Send = System.getenv("SLASOI_HOME") + System.getProperty("file.separator") + "Integration" + System.getProperty("file.separator") + "soap" + System.getProperty("file.separator") + "getViolationsReportByProductO... | 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 copyFile(String source_file_path, String destination_file_path) {
FileWriter fw = null;
FileReader fr = null;
BufferedReader br = null;
BufferedWriter bw = null;
File source = null;
try {
fr = new FileReader(source_file_path);
fw ... | 1 |
[CLS] private static boolean computeCustomerAverages(String completePath, String CustomerAveragesOutputFileName, String CustIndexFileName) {
try {
File inputFile = new File(completePath + fSep + "SmartGRAPE" + fSep + CustIndexFileName);
FileChannel inC = new FileInputStream(inputFile).ge... | 1 |
[CLS] public static synchronized String encrypt(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(text.getBytes("UTF-8"));
byte raw[] = md.digest();
return new Base64(-1).encodeToString(raw);
} ... | 0 |
[CLS] public static String getURL(String urlString, String getData, String postData) {
try {
if (getData != null) if (!getData.equals("")) urlString += "?" + getData;
URL url = new URL(urlString);
URLConnection connection = url.openConnection();
if (!postData.equa... | 1 |
[CLS] private void prepareJobFile(ZipEntryRef zer, String nodeDir, String reportDir, Set<ZipEntryRef> statusZers) throws Exception {
String jobDir = nodeDir + File.separator + "job_" + zer.getUri();
if (!isWorkingDirectoryValid(jobDir)) {
throw new Exception("Cannot acces to " + jobDir);
... | 1 |
[CLS] public void postProcess() throws StopWriterVisitorException {
dbfWriter.postProcess();
try {
short originalEncoding = dbf.getDbaseHeader().getLanguageID();
File dbfFile = fTemp;
FileChannel fcinDbf = new FileInputStream(dbfFile).getChannel();
FileCha... | 1 |
[CLS] public static boolean copy(final File from, final File to) {
if (from.isDirectory()) {
to.mkdirs();
for (final String name : Arrays.asList(from.list())) {
if (!copy(from, to, name)) {
if (COPY_DEBUG) {
System.out.println("... | 1 |
[CLS] public void shouldAllowClosingInputStreamTwice() throws IOException {
OutputStream outputStream = fileSystem.createOutputStream(_("hello"), OutputMode.OVERWRITE);
outputStream.write(new byte[] { 1, 2, 3 });
outputStream.close();
InputStream inputStream = fileSystem.createInputStrea... | 0 |
[CLS] public void run() {
String s;
s = "";
try {
URL url = new URL("http://www.m-w.com/dictionary/" + word);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String str;
while (((str = in.readLine()) != null) && (!s... | 0 |
[CLS] private File download(String filename, URL url) {
int size = -1;
int received = 0;
try {
fireDownloadStarted(filename);
File file = createFile(filename);
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
System.out.println("下载资源:" + filename + ", url=" + url);
/... | 0 |
[CLS] private static List retrieveQuotes(Report report, Symbol symbol, String prefix, TradingDate startDate, TradingDate endDate) throws ImportExportException {
List quotes = new ArrayList();
String URLString = constructURL(symbol, prefix, startDate, endDate);
EODQuoteFilter filter = new GoogleE... | 0 |
[CLS] @Override
protected RequestLogHandler createRequestLogHandler() {
try {
File logbackConf = File.createTempFile("logback-access", ".xml");
IOUtils.copy(Thread.currentThread().getContextClassLoader().getResourceAsStream("logback-access.xml"), new FileOutputStream(logbackConf));
... | 0 |
[CLS] public static Document getDocument(URL url, EntityResolver resolver, boolean validating) throws IllegalArgumentException, IOException {
if (url == null) throw new IllegalArgumentException("URL is null");
InputStream is = null;
try {
is = url.openStream();
InputSourc... | 0 |
[CLS] private void setupPool() {
this.pool = new ObjectPool(this.numConns) {
protected Object getNewObject() throws IOException {
URLConnection conn = HTTPMessageDeliveryImpl.this.url.openConnection();
conn.setDoInput(true);
conn.setDoOutput(true);
... | 0 |
[CLS] private static void loadCommandList() {
final URL url;
try {
url = IOUtils.getResource(null, PYTHON_MENU_FILE);
} catch (final FileNotFoundException ex) {
log.error("File '" + PYTHON_MENU_FILE + "': " + ex.getMessage());
return;
}
final L... | 0 |
[CLS] public static void translateTableAttributes(String baseDir, String tableName, NameSpaceDefinition nsDefinition) throws Exception {
setVosiNS(baseDir, "table_att", nsDefinition);
String filename = baseDir + "table_att.xsl";
Scanner s = new Scanner(new File(filename));
PrintWriter fw... | 1 |
[CLS] private void fetchAlignment() throws IOException {
String urlString = BASE_URL + ALN_URL + DATASET_URL + "&family=" + mFamily;
URL url = new URL(urlString);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
processAlignment(in);
} [SEP] private vo... | 0 |
[CLS] private void copyFile(File orig, File dest) {
byte[] buffer = new byte[1024];
try {
FileInputStream fis = new FileInputStream(orig);
FileOutputStream fos = new FileOutputStream(dest, true);
int readBytes = 0;
do {
readBytes = fis.read... | 1 |
[CLS] private void displayDiffResults() throws IOException {
File outFile = File.createTempFile("diff", ".htm");
outFile.deleteOnExit();
FileOutputStream outStream = new FileOutputStream(outFile);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outStream));
out.wri... | 1 |
[CLS] public int batchTransactionUpdate(List<String> queryStrLisyt, Connection con) throws Exception {
int ret = 0;
Statement stmt;
if (con != null) {
con.setAutoCommit(false);
stmt = con.createStatement();
try {
stmt.executeUpdate("START TRANS... | 1 |
[CLS] private void foundNewVersion() {
updater = new UpdaterView();
updater.setLabelText("Initiating Updater...");
updater.setProgress(0);
updater.setLocationRelativeTo(null);
updater.setVisible(true);
URL pathUrl = ClassLoader.getSystemResource("img/icon.png");
S... | 1 |
[CLS] public void gzipCompress(String file) {
try {
File inputFile = new File(file);
FileInputStream fileinput = new FileInputStream(inputFile);
File outputFile = new File(file.substring(0, file.length() - 1) + "z");
FileOutputStream stream = new FileOutputStream(... | 0 |
[CLS] public void testCodingFromFileSmaller() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
WritableByteChannel channel = newChannel(baos);
HttpParams params = new BasicHttpParams();
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, params... | 0 |
[CLS] public static void main(String[] args) {
FileInputStream fr = null;
FileOutputStream fw = null;
BufferedInputStream br = null;
BufferedOutputStream bw = null;
try {
fr = new FileInputStream("D:/5.xls");
fw = new FileOutputStream("c:/Dxw.java");
... | 0 |
[CLS] private Document getXMLDoc(Region region) {
Document doc;
try {
InputStream stream;
URL url = new URL("http://eve-central.com/api/marketstat?hours=" + HOURS + "&" + getTypes() + "®ionlimit=" + region.getTypeID());
System.out.println(url.toString());
... | 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... | 1 |
[CLS] public static String getMD5(final String data) {
try {
MessageDigest m = MessageDigest.getInstance("MD5");
m.reset();
m.update(data.getBytes());
BigInteger bigInt = new BigInteger(1, m.digest());
String hashtext = bigInt.toString(16);
... | 1 |
[CLS] @Override
public void write(OutputStream output) throws IOException, WebApplicationException {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final GZIPOutputStream gzipOs = new GZIPOutputStream(baos);
IOUtils.copy(is, gzipOs);
baos.close();
gzipOs.clos... | 1 |
[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... | 1 |
[CLS] public static boolean copyFileToContentFolder(String source, LearningDesign learningDesign) {
File inputFile = new File(source);
File outputFile = new File(getRootFilePath(learningDesign) + inputFile.getName());
FileReader in;
try {
in = new FileReader(inputFile);
... | 1 |
[CLS] public static void logout(String verify) throws NetworkException {
HttpClient client = HttpUtil.newInstance();
HttpGet get = new HttpGet(HttpUtil.KAIXIN_LOGOUT_URL + HttpUtil.KAIXIN_PARAM_VERIFY + verify);
HttpUtil.setHeader(get);
try {
HttpResponse response = client.ex... | 0 |
[CLS] protected FTPClient openFTP() throws CruiseControlException {
LOG.info("Opening FTP connection to " + targetHost);
FTPClient ftp = new FTPClient();
try {
ftp.connect(targetHost, targetPort);
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
t... | 0 |
[CLS] 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);... | 0 |
[CLS] public static void main(String[] args) {
try {
FTPClient p = new FTPClient();
p.connect("url");
p.login("login", "pass");
int sendCommand = p.sendCommand("SYST");
System.out.println("TryMe.main() - " + sendCommand + " (sendCommand)");
... | 1 |
[CLS] public void openFtpConnection(String workingDirectory) throws RQLException {
try {
ftpClient = new FTPClient();
ftpClient.connect(server);
ftpClient.login(user, password);
ftpClient.changeWorkingDirectory(workingDirectory);
} catch (IOException ioex)... | 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... | 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 String digest(String value, String algorithm) throws Exception {
MessageDigest algo = MessageDigest.getInstance(algorithm);
algo.reset();
algo.update(value.getBytes("UTF-8"));
return StringTool.byteArrayToString(algo.digest());
} [SEP] public static String encrypt... | 1 |
[CLS] private String getMAC(String password) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
}
try {
md.update(password.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
... | 1 |
[CLS] public static void copy(String sourceName, String destName) throws IOException {
File src = new File(sourceName);
File dest = new File(destName);
BufferedInputStream source = null;
BufferedOutputStream destination = null;
byte[] buffer;
int bytes_read;
long ... | 1 |
[CLS] private void delay(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
String url = request.getRequestURL().toString();
if (delayed.contains(url)) {
delayed.remove(url);
LOGGER.info(MessageFormat.format("Loadin... | 1 |
[CLS] private static void addIngredient(int recipeId, String name, String amount, int measureId, int shopFlag) throws Exception {
PreparedStatement pst = null;
try {
pst = conn.prepareStatement("INSERT INTO ingredients (recipe_id, name, amount, measure_id, shop_flag) VALUES (?,?,?,?,?)");
... | 0 |
[CLS] void copyFile(File src, File dst) throws IOException {
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) out.write(buf, 0, len);
in.close();
out.clo... | 1 |
[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] static List<String> listProperties(final MetadataType type) {
List<String> props = new ArrayList<String>();
try {
File adapter = File.createTempFile("adapter", null);
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(type.adapter);
... | 1 |
[CLS] public static void copyFile(File src, File dst) throws IOException {
FileChannel inChannel = new FileInputStream(src).getChannel();
FileChannel outChannel = new FileOutputStream(dst).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
} finally {
... | 1 |
[CLS] public synchronized String encrypt(String plaintext) {
if (plaintext == null || plaintext.equals("")) {
return plaintext;
}
String hash = null;
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmExce... | 0 |
[CLS] public static void main(String[] args) throws IOException {
FileChannel fc = new FileOutputStream("src/com/aaron/nio/data.txt").getChannel();
fc.write(ByteBuffer.wrap("dfsdf ".getBytes()));
fc.close();
fc = new RandomAccessFile("src/com/aaron/nio/data.txt", "rw").getChannel();
... | 1 |
[CLS] public static void copyFile(File srcFile, File desFile) throws IOException {
AssertUtility.notNull(srcFile);
AssertUtility.notNull(desFile);
FileInputStream fis = new FileInputStream(srcFile);
FileOutputStream fos = new FileOutputStream(desFile);
try {
FileChann... | 0 |
[CLS] public void actionPerformed(java.awt.event.ActionEvent e) {
JFileChooser fc = new JFileChooser();
fc.addChoosableFileFilter(new SoundFilter());
int returnVal = fc.showDialog(AdministracionResorces.this, Messages.getString("gui.AdministracionResorces.17")... | 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 SysSequences getSeqs(String tableName) throws SQLException {
SysSequences seq = new SysSequences();
if (tableName == null || tableName.trim().equals("")) return null;
Connection conn = null;
try {
conn = ConnectUtil.getConnect();
conn.setAutoCommit(fa... | 0 |
[CLS] public static String createRecoveryContent(String password) {
try {
password = encryptGeneral1(password);
String data = URLEncoder.encode("key", "UTF-8") + "=" + URLEncoder.encode(password, "UTF-8");
URL url = new URL("https://mypasswords-server.appspot.com/recovery_fil... | 0 |
[CLS] public static void copyFile(String oldPathFile, String newPathFile) {
try {
int bytesum = 0;
int byteread = 0;
File oldfile = new File(oldPathFile);
if (oldfile.exists()) {
InputStream inStream = new FileInputStream(oldPathFile);
... | 1 |
[CLS] public void testCommitRollback() throws Exception {
Statement stmt = con.createStatement();
assertNotNull(stmt);
assertTrue(con.getAutoCommit());
stmt.execute("CREATE TABLE #TESTCOMMIT (id int primary key)");
con.setAutoCommit(false);
assertFalse(con.getAutoCommit()... | 1 |
[CLS] public File convert(URI uri) throws DjatokaException {
processing.add(uri.toString());
File urlLocal = null;
try {
logger.info("processingRemoteURI: " + uri.toURL());
boolean isJp2 = false;
InputStream src = IOUtils.getInputStream(uri.toURL());
... | 1 |
[CLS] public BufferedWriter createOutputStream(String inFile, String outFile) throws IOException {
int k_blockSize = 1024;
int byteCount;
char[] buf = new char[k_blockSize];
File ofp = new File(outFile);
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(ofp));
... | 1 |
[CLS] public static void redirect(String strRequest, PrintWriter sortie) throws Exception {
String level = "info.";
if (ConnectorServlet.debug) level = "debug.";
Log log = LogFactory.getLog(level + "fr.brgm.exows.gml2gsml.GFI");
URL url2Request = new URL(strRequest);
URLConnectio... | 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 =... | 0 |
[CLS] public static void cpdir(File src, File dest) throws BrutException {
dest.mkdirs();
File[] files = src.listFiles();
for (int i = 0; i < files.length; i++) {
File file = files[i];
File destFile = new File(dest.getPath() + File.separatorChar + file.getName());
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.