text string | label int64 |
|---|---|
[CLS] public static Set<Province> getProvincias(String pURL) {
Set<Province> result = new HashSet<Province>();
String iniProv = "<prov>";
String finProv = "</prov>";
String iniNomProv = "<np>";
String finNomProv = "</np>";
String iniCodigo = "<cpine>";
String finC... | 0 |
[CLS] public String gen() {
String plainText = this.password;
MessageDigest mdAlgorithm;
StringBuffer hexString = new StringBuffer();
try {
mdAlgorithm = MessageDigest.getInstance("MD5");
mdAlgorithm.update(plainText.getBytes());
byte[] digest = mdAlgo... | 1 |
[CLS] protected void downgradeHistory(Collection<String> versions) {
Assert.notEmpty(versions);
try {
Connection connection = this.database.getDefaultConnection();
PreparedStatement statement = connection.prepareStatement("UPDATE " + this.logTableName + " SET RESULT = 'DOWNGRADED... | 1 |
[CLS] private void btnOkActionPerformed(java.awt.event.ActionEvent evt) {
if (validateData()) {
LoginUser me = AdministrationPanelView.getMe();
Connection dbConnection = null;
try {
DriverManager.registerDriver(new com.mysql.jdbc.Driver());
dbC... | 0 |
[CLS] public static void copyTo(File inFile, File outFile) throws IOException {
char[] cbuff = new char[32768];
BufferedReader reader = new BufferedReader(new FileReader(inFile));
BufferedWriter writer = new BufferedWriter(new FileWriter(outFile));
int readedBytes = 0;
long absWr... | 0 |
[CLS] public void doCompress(File[] files, File out, List<String> excludedKeys) {
Map<String, File> map = new HashMap<String, File>();
String parent = FilenameUtils.getBaseName(out.getName());
for (File f : files) {
CompressionUtil.list(f, parent, map, excludedKeys);
}
... | 1 |
[CLS] public static String getStringResponse(String urlString) throws Exception {
URL url = new URL(urlString);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine;
StringBuilder buffer = new StringBuilder();
while ((inputLine = in.re... | 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] private void copyFile(File in, File out) {
try {
FileChannel sourceChannel = new FileInputStream(in).getChannel();
FileChannel destinationChannel = new FileOutputStream(out).getChannel();
sourceChannel.transferTo(0, sourceChannel.size(), destinationChannel);
... | 1 |
[CLS] @Override
public String compute_hash(String plaintext) {
MessageDigest d;
try {
d = MessageDigest.getInstance(get_algorithm_name());
d.update(plaintext.getBytes());
byte[] hash = d.digest();
StringBuffer sb = new StringBuffer();
for (... | 1 |
[CLS] public static void copyDirs(File sourceDir, File destDir) throws IOException {
if (!destDir.exists()) destDir.mkdirs();
for (File file : sourceDir.listFiles()) {
if (file.isDirectory()) {
copyDirs(file, new File(destDir, file.getName()));
} else {
... | 1 |
[CLS] public static String calculateHash(String password) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA-1");
md.reset();
} catch (NoSuchAlgorithmException ex) {
ex.printStackTrace();
}
md.update(password.getBytes());
... | 1 |
[CLS] private boolean processar(int iCodProd) {
String sSQL = null;
String sSQLCompra = null;
String sSQLInventario = null;
String sSQLVenda = null;
String sSQLRMA = null;
String sSQLOP = null;
String sSQLOP_SP = null;
String sWhere = null;
String ... | 1 |
[CLS] protected 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.upda... | 1 |
[CLS] @SuppressWarnings("unchecked")
protected void displayFreeMarkerResponse(HttpServletRequest request, HttpServletResponse response, String templateName, Map<String, Object> variableMap) throws IOException {
Enumeration<String> attrNameEnum = request.getSession().getAttributeNames();
String attrN... | 1 |
[CLS] public void run() {
if (data.length() > 0) {
String method = getMethod();
String action = getAction();
URL url;
try {
URL actionURL;
URL baseURL = hdoc.getBase();
if (action == n... | 0 |
[CLS] public List<String> loadList(String name) {
List<String> ret = new ArrayList<String>();
try {
URL url = getClass().getClassLoader().getResource("lists/" + name + ".utf-8");
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"));
... | 0 |
[CLS] private File downloadPDB(String pdbId) {
File tempFile = new File(path + "/" + pdbId + ".pdb.gz");
File pdbHome = new File(path);
if (!pdbHome.canWrite()) {
System.err.println("can not write to " + pdbHome);
return null;
}
String ftp = String.format(... | 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] public synchronized String getEncryptedPassword(String plaintext, String algorithm) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md = null;
try {
md = MessageDigest.getInstance(algorithm);
md.update(plaintext.getBytes("UTF-8"));
} ca... | 1 |
[CLS] public void add(AddInterceptorChain chain, Entry entry, LDAPConstraints constraints) throws LDAPException {
Connection con = (Connection) chain.getRequest().get(JdbcInsert.MYVD_DB_CON + this.dbInsertName);
if (con == null) {
throw new LDAPException("Operations Error", LDAPException.OPE... | 0 |
[CLS] public boolean moveFileSafely(final File in, final File out) throws IOException {
FileInputStream fis = null;
FileOutputStream fos = null;
FileChannel inChannel = null;
FileChannel outChannel = null;
final File tempOut = File.createTempFile("move", ".tmp");
try {
... | 1 |
[CLS] public void generate(FileObject outputDirectory, FileObject generatedOutputDirectory, List<Library> libraryModels, String tapdocXml) throws FileSystemException {
if (!outputDirectory.exists()) {
outputDirectory.createFolder();
}
ZipUtils.extractZip(new ClasspathResource(classRe... | 1 |
[CLS] private void runUpdateAppListing() {
DataStorage.clearListedAppListing();
GenericUrl url = new GoogleUrl(EnterpriseMarketplaceUrl.generateAppListingUrl() + DataStorage.getVendorProfile().vendorId);
AppListing appListingBody = buildAppListing(appsMarketplaceProject);
JsonHttpContent... | 0 |
[CLS] private String hashPassword(String password) {
if (password != null && password.trim().length() > 0) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(password.trim().getBytes());
BigInteger hash = new BigInteger(1, md5.dig... | 0 |
[CLS] public final void copyFile(final File fromFile, final File toFile) throws IOException {
this.createParentPathIfNeeded(toFile);
final FileChannel sourceChannel = new FileInputStream(fromFile).getChannel();
final FileChannel targetChannel = new FileOutputStream(toFile).getChannel();
... | 1 |
[CLS] public void actionPerformed(ActionEvent e) {
final File inputFile = KeyboardHero.midiFile();
try {
if (inputFile == null) return;
final File dir = (new File(Util.DATA_FOLDER + MidiSong.MIDI_FILES_DIR));
if (dir.exists()) {... | 1 |
[CLS] public static String encrypt(String text) {
MessageDigest md;
try {
md = MessageDigest.getInstance("MD5");
byte[] md5hash = new byte[32];
md.update(text.getBytes("UTF-8"), 0, text.length());
md5hash = md.digest();
return convertToHex(md5h... | 1 |
[CLS] public static void resourceToFile(final String resource, final String filePath) throws IOException {
log.debug("Classloader is " + IOCopyUtils.class.getClassLoader());
InputStream in = IOCopyUtils.class.getResourceAsStream(resource);
if (in == null) {
log.warn("Resource not '" ... | 1 |
[CLS] public AbstractASiCSignatureService(InputStream documentInputStream, DigestAlgo digestAlgo, RevocationDataService revocationDataService, TimeStampService timeStampService, String claimedRole, IdentityDTO identity, byte[] photo, TemporaryDataStorage temporaryDataStorage, OutputStream documentOutputStream) throws I... | 1 |
[CLS] public static void copia(File nombreFuente, File nombreDestino) throws IOException {
FileInputStream fis = new FileInputStream(nombreFuente);
FileOutputStream fos = new FileOutputStream(nombreDestino);
FileChannel canalFuente = fis.getChannel();
FileChannel canalDestino = fos.getCh... | 1 |
[CLS] private void send(java.awt.event.ActionEvent evt) {
String url = this.getURL();
if (url != null) {
String tinyurl = "";
try {
URLConnection conn = new URL("http://tinyurl.com/api-create.php?url=" + url).openConnection();
conn.setDoInput(true)... | 0 |
[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] public void updateCoordinates(Address address) {
String mapURL = "http://maps.google.com/maps/geo?output=csv";
String mapKey = "ABQIAAAAi__aT6y6l86JjbootR-p9xQd1nlEHNeAVGWQhS84yIVN5yGO2RQQPg9QLzy82PFlCzXtMNe6ofKjnA";
String location = address.getStreet() + " " + address.getZip() + " " + ad... | 1 |
[CLS] private void weightAndPlaceClasses() {
int rows = getRows();
for (int curRow = _maxPackageRank; curRow < rows; curRow++) {
xPos = getHGap() / 2;
BOTLRuleDiagramNode[] rowObject = getObjectsInRow(curRow);
for (int i = 0; i < rowObject.length; i++) {
... | 0 |
[CLS] @SuppressWarnings("unchecked")
public static void zip(String input, OutputStream out) {
File file = new File(input);
ZipOutputStream zip = null;
FileInputStream in = null;
try {
if (file.exists()) {
Collection<File> items = new ArrayList();
... | 1 |
[CLS] public static void load(String path) {
if (path.length() < 1) {
Log.userinfo("Cannot open a file whose name has zero length.", Log.ERROR);
}
if (!loadtime) {
if (path.equals(Globals.getStartupFilePath())) {
Log.userinfo("Cannot reload startup file.",... | 0 |
[CLS] public static void copyFile(File in, File outDir) throws IOException {
FileChannel sourceChannel = null;
FileChannel destinationChannel = null;
try {
sourceChannel = new FileInputStream(in).getChannel();
File out = new File(outDir, in.getName());
destina... | 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] public String getHashedPhoneId(Context aContext) {
if (hashedPhoneId == null) {
final String androidId = BuildInfo.getAndroidID(aContext);
if (androidId == null) {
hashedPhoneId = "EMULATOR";
} else {
try {
final Messa... | 1 |
[CLS] private void doDecrypt(boolean createOutput) throws IOException {
FileInputStream input = null;
FileOutputStream output = null;
File tempOutput = null;
try {
input = new FileInputStream(infile);
String cipherBaseFilename = basename(infile);
byte[... | 1 |
[CLS] public void updatePortletName(PortletNameBean portletNameBean) {
DatabaseAdapter dbDyn = null;
PreparedStatement ps = null;
try {
dbDyn = DatabaseAdapter.getInstance();
String sql = "update WM_PORTAL_PORTLET_NAME " + "set TYPE=? " + "where ID_SITE_CTX_TYPE=?";
... | 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] Library(MainFrame mf, boolean newLibrary, String templateName, String newFileName) throws Exception {
mainFrame = mf;
trackMap = new HashMap<String, LibraryTrack>();
trackVec = new Vector<LibraryTrack>();
String propFileName = null;
File propFile = null;
String notE... | 0 |
[CLS] protected static DynamicJasperDesign generateJasperDesign(DynamicReport dr) throws CoreException {
DynamicJasperDesign jd = null;
try {
if (dr.getTemplateFileName() != null) {
log.info("loading template file: " + dr.getTemplateFileName());
log.info("Atte... | 0 |
[CLS] public static long download(String address, String localFileName) throws Exception {
OutputStream out = null;
URLConnection conn = null;
InputStream in = null;
long numWritten = 0;
try {
URL url = new URL(address);
out = new BufferedOutputStream(new ... | 0 |
[CLS] public String translate(String before, int translateType) throws CoreException {
if (before == null) throw new IllegalArgumentException("before is null.");
if ((translateType != ENGLISH_TO_JAPANESE) && (translateType != JAPANESE_TO_ENGLISH)) {
throw new IllegalArgumentException("Invali... | 0 |
[CLS] public static void main(String[] args) throws Exception {
URI uri = new URI("file:/c:/foo.xyz");
System.err.println(uri);
uri = new URI("bin.file:/c:/foo.xyz");
System.err.println(uri);
uri = new URI("bin.http://c:/foo.xyz");
System.err.println(uri);
uri = n... | 0 |
[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 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... | 1 |
[CLS] private static void fileUpload() throws IOException {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(postURL);
file = new File("h:/UploadingdotcomUploaderPlugin.java");
MultipartEntity mpEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPA... | 0 |
[CLS] public LogoutHandler(String username, String token) {
try {
URL url = new URL("http://eiffel.itba.edu.ar/hci/service/Security.groovy?method=LogOut&username=" + username + "&authentication_token=" + token);
URLConnection urlc = url.openConnection();
urlc.setDoOutput(fals... | 1 |
[CLS] public boolean backup() {
try {
File sd = Environment.getExternalStorageDirectory();
File data = Environment.getDataDirectory();
if (sd.canWrite()) {
String currentDBPath = "/data/android.bluebox/databases/bluebox.db";
String backupDBPath... | 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] public static boolean copyFile(final File fileFrom, final File fileTo) {
assert fileFrom != null : "fileFrom is null";
assert fileTo != null : "fileTo is null";
LOGGER.info(buildLogString(COPY_FILE_INFO, new Object[] { fileFrom, fileTo }));
boolean error = true;
FileInputSt... | 1 |
[CLS] protected void removeMessage(ReplicationMessage message) {
logger.info(String.format("remove replication message: %d", message.getId()));
ConnectionProvider cp = null;
Connection conn = null;
PreparedStatement ps = null;
try {
SessionFactoryImplementor impl = (S... | 0 |
[CLS] public static void main(String[] args) throws IOException {
FileOutputStream f = new FileOutputStream("test.zip");
CheckedOutputStream csum = new CheckedOutputStream(f, new Adler32());
ZipOutputStream zos = new ZipOutputStream(csum);
BufferedOutputStream out = new BufferedOutputStr... | 0 |
[CLS] public void testAddingEntries() throws Exception {
DiskCache c = new DiskCache();
{
c.setRoot(rootFolder.getAbsolutePath());
c.setHtmlExtension("htm");
c.setPropertiesExtension("txt");
assertEquals("htm", c.getHtmlExtension());
assertEqua... | 1 |
[CLS] private synchronized void executePrebuildCache() {
isPrebuilding = true;
String pathStr = "";
String[] paths = null;
XMLCacheBuilder cacheBuilder = null;
if (this.getConfigPath() != null) {
cacheBuilder = CompositePageUtil.getCacheBuilder();
if (cach... | 0 |
[CLS] private int addPollToDB(DataSource database) {
int pollid = -2;
Connection con = null;
try {
con = database.getConnection();
con.setAutoCommit(false);
String add = "insert into polls" + " values( ?, ?, ?, ?)";
PreparedStatement prepStatement ... | 0 |
[CLS] public static void encryptFile(String infile, String outfile, String keyFile) throws Exception {
javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("DES/ECB/PKCS5Padding");
cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, getKey());
java.io.FileInputStream in = new java.io.FileInput... | 1 |
[CLS] private String mkSid() {
String temp = toString();
MessageDigest messagedigest = null;
try {
messagedigest = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
}
messagediges... | 1 |
[CLS] public static void main(String[] args) throws Exception {
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet("https://portal.sun.com/portal/dt");
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
... | 0 |
[CLS] private boolean copy_to_file_io(File src, File dst) throws IOException {
InputStream is = null;
OutputStream os = null;
try {
is = new FileInputStream(src);
is = new BufferedInputStream(is);
os = new FileOutputStream(dst);
os = new BufferedOu... | 1 |
[CLS] public boolean limpiarContrincantexRonda(jugadorxDivxRonda unjxdxr) {
int intResult = 0;
String sql = "UPDATE jugadorxdivxronda " + " SET idPareoRival = 0 " + " WHERE idJugxDivxRnd = " + unjxdxr.getIdJugxDivxRnd();
try {
connection = conexionBD.getConnection();
conn... | 0 |
[CLS] public synchronized void receive(MessageEvent e) {
switch(e.message.getType()) {
case MessageTypes.QUIT:
activeSessions--;
break;
case MessageTypes.SHUTDOWN_SERVER:
activeSessions--;
if (Options.password.trim().equals(... | 0 |
[CLS] public static synchronized String getSequenceNumber(String SequenceName) {
String result = "";
Connection conn = null;
Statement ps = null;
ResultSet rs = null;
try {
conn = TPCW_Database.getConnection();
conn.setAutoCommit(false);
String... | 1 |
[CLS] private Set read() throws IOException {
URL url = new URL(urlPrefix + channelId + ".dat");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String line = in.readLine();
Set programs = new HashSet();
while (line != null) {
String[]... | 1 |
[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 Program updateProgramPath(int id, String sourcePath) throws AdaptationException {
Program program = null;
Connection connection = null;
Statement statement = null;
ResultSet resultSet = null;
try {
String query = "UPDATE Programs SET " + "sourcePath = '" ... | 0 |
[CLS] private Source getStylesheetSource(String stylesheetResource) throws ApplicationContextException {
if (LOG.isDebugEnabled()) {
LOG.debug("Loading XSLT stylesheet from " + stylesheetResource);
}
try {
URL url = this.getClass().getClassLoader().getResource(stylesheetR... | 0 |
[CLS] public String getClass(EmeraldjbBean eb) throws EmeraldjbException {
Entity entity = (Entity) eb;
StringBuffer sb = new StringBuffer();
String myPackage = getPackageName(eb);
sb.append("package " + myPackage + ";\n");
sb.append("\n");
DaoValuesGenerator valgen = new... | 1 |
[CLS] public static void copyFile(File sourceFile, File destFile) throws IOException {
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChannel();
destination = new FileOutputStream(destFile).getChannel();
... | 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() + ".");
... | 1 |
[CLS] private synchronized void createFTPConnection() throws FTPBrowseException {
ftpClient = new FTPClient();
try {
InetAddress inetAddress = InetAddress.getByName(url.getHost());
if (url.getPort() == -1) {
ftpClient.connect(inetAddress);
} else {
... | 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 ... | 1 |
[CLS] public static String getMD5(String password) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
String salt = "UseTheForce4";
password = salt + password;
md5.update(password.getBytes(), 0, password.length());
password = new BigInteger(... | 0 |
[CLS] private static void extract(ZipFile zipFile) throws Exception {
FileUtils.deleteQuietly(WEBKIT_DIR);
WEBKIT_DIR.mkdirs();
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
... | 1 |
[CLS] public void saveUploadFiles(List uploadFiles) throws SQLException {
Connection conn = AppLayerDatabase.getInstance().getPooledConnection();
try {
conn.setAutoCommit(false);
Statement s = conn.createStatement();
s.executeUpdate("DELETE FROM UPLOADFILES");
... | 1 |
[CLS] public void modifyBubble(int[] array) {
for (int i = 0; i < array.length; i++) {
if (i % 2 != 0) {
for (int j = array.length - i / 2 - 2; j >= i / 2; j--) {
if (array[j] >= array[j + 1]) {
int temp = array[j];
... | 0 |
[CLS] public void connectToUrl(String url_address) {
message = new StringBuffer("");
try {
URL url = new URL(url_address);
try {
HttpsURLConnection httpsConnection = (HttpsURLConnection) url.openConnection();
httpsConnection.setDoOutput(false);
... | 0 |
[CLS] public void jsFunction_extract(ScriptableFile outputFile) throws IOException, FileSystemException, ArchiveException {
InputStream is = file.jsFunction_createInputStream();
OutputStream output = outputFile.jsFunction_createOutputStream();
BufferedInputStream buf = new BufferedInputStream(is... | 1 |
[CLS] public void createControl(Composite parent) {
top = new Composite(parent, SWT.NONE);
top.setLayout(new GridLayout());
top.setLayoutData(new GridData(GridData.FILL_BOTH));
ComposedAdapterFactory factories = new ComposedAdapterFactory();
factories.addAdapterFactory(new EcoreI... | 0 |
[CLS] public static void fileCopy(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] @Override
public void actionPerformed(ActionEvent e) {
if (copiedFiles_ != null) {
File[] tmpFiles = new File[copiedFiles_.length];
File tmpDir = new File(Settings.getPropertyString(ConstantKeys.project_dir), "tmp/");
tmpDir.mkdirs();
... | 1 |
[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 updateViewerContent(ScrollingGraphicalViewer viewer) {
BioPAXGraph graph = (BioPAXGraph) viewer.getContents().getModel();
if (!graph.isMechanistic()) return;
Map<String, Color> highlightMap = new HashMap<String, Color>();
for (Object o : graph.getNodes()) {
... | 0 |
[CLS] private FileLog(LOG_LEVEL displayLogLevel, LOG_LEVEL logLevel, String logPath) {
this.logLevel = logLevel;
this.displayLogLevel = displayLogLevel;
if (null != logPath) {
logFile = new File(logPath, "current.log");
log(LOG_LEVEL.DEBUG, "FileLog", "Initialising logfil... | 1 |
[CLS] public static HashCash mintCash(String resource, Map<String, List<String>> extensions, Calendar date, int value, int version) throws NoSuchAlgorithmException {
if (version < 0 || version > 1) throw new IllegalArgumentException("Only supported versions are 0 and 1");
if (value < 0 || value > hashLe... | 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 NodeList getNodeListForDataFile(String fileName, String dataType) {
NodeList list = null;
try {
URL url = new URL(WEBSITE_PROTOCAL, WEBSITE_HOST, "/" + fileName + ".xml");
InputStream is = url.openStream();
DocumentBuilderFactory dbf = DocumentBuilderFac... | 0 |
[CLS] public void migrate(InputMetadata meta, InputStream input, OutputCreator outputCreator) throws IOException, ResourceMigrationException {
RestartInputStream restartInput = new RestartInputStream(input);
Match match = resourceIdentifier.identifyResource(meta, restartInput);
restartInput.rest... | 1 |
[CLS] public File mergeDoc(URL urlDoc, File fOutput, boolean bMulti) throws Exception {
if (s_log.isTraceEnabled()) trace(0, "Copying from " + urlDoc.toString() + " to " + fOutput.toString());
File fOut = null;
InputStream is = null;
try {
is = urlDoc.openStream();
... | 0 |
[CLS] public void saveUploadFile(String toFileName, UploadFile uploadFile, SysConfig sysConfig) throws IOException {
OutputStream bos = new FileOutputStream(toFileName);
IOUtils.copy(uploadFile.getInputStream(), bos);
if (sysConfig.isAttachImg(uploadFile.getFileName()) && sysConfig.getReduceAtta... | 1 |
[CLS] public static boolean copyFile(final File fileFrom, final File fileTo) {
assert fileFrom != null : "fileFrom is null";
assert fileTo != null : "fileTo is null";
LOGGER.info(buildLogString(COPY_FILE_INFO, new Object[] { fileFrom, fileTo }));
boolean error = true;
FileInputSt... | 1 |
[CLS] public static String compute(String text) {
try {
MessageDigest md;
md = MessageDigest.getInstance("MD5");
byte[] md5hash = new byte[32];
md.update(text.getBytes("UTF-8"), 0, text.length());
md5hash = md.digest();
return convertToHex(... | 1 |
[CLS] public static String readRss(String feed, int num) {
InputStream stream = null;
try {
feed = appendParam(feed, "num", "" + num);
System.out.println("feed=" + feed);
URL url = new URL(feed);
URLConnection connection = url.openConnection();
... | 0 |
[CLS] public Writer createWriter(File outfile, String encoding) throws UnsupportedEncodingException, IOException {
int k_blockSize = 1024;
int byteCount;
char[] buf = new char[k_blockSize];
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(outfile));
zos.setMethod(Zi... | 1 |
[CLS] public BufferedImage extract() throws DjatokaException {
boolean useRegion = false;
int left = 0;
int top = 0;
int width = 50;
int height = 50;
boolean useleftDouble = false;
Double leftDouble = 0.0;
boolean usetopDouble = false;
Double topDo... | 1 |
[CLS] @Override
public void run() {
try {
FileChannel out = new FileOutputStream(outputfile).getChannel();
long pos = 0;
status.setText("Slučovač: Proces Slučování spuštěn.. Prosím čekejte..");
for (int i = 1; i <= noofparts; i++) {
FileChannel... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.