public void actionPerformed(ActionEvent e) { String p = tfstorepath.getText(); String relp = SUtil.convertPathToRelative(p); secservice.setKeystoreInfo(relp, tfstorepass.getText(), tfkeypass.getText()); } });
public void actionPerformed(ActionEvent e) { String p = tfstorepath.getText(); String relp = SUtil.convertPathToRelative(p); secservice.setKeystoreInfo(relp, tfstorepass.getText(), tfkeypass.getText()); } });
public void actionPerformed(ActionEvent e) { if(fc==null) { fc = new JFileChooser("."); } fc.showOpenDialog(inner); File sel = fc.getSelectedFile(); if(sel!=null && sel.exists()) { try { tfstorepath.setText(SUtil.convertPathToRelative(sel.getAbsolutePath())); } catch(Exception ex) { ex.printStackTrace(); } } } });
public void actionPerformed(ActionEvent e) { if(fc==null) { fc = new JFileChooser("."); } fc.showOpenDialog(inner); File sel = fc.getSelectedFile(); if(sel!=null && sel.exists()) { try { tfstorepath.setText(SUtil.convertPathToRelative(sel.getAbsolutePath())); } catch(Exception ex) { ex.printStackTrace(); } } } });
/** * Get the corresponding relative path for a file. * Handles jars specially. */ protected static String convertPathToRelative(File file) { String ret; if(file instanceof JarAsDirectory) { JarAsDirectory jar = (JarAsDirectory)file; if(jar.getZipEntry()!=null) ret = jar.getZipEntry().getName(); else ret = SUtil.convertPathToRelative(jar.getJarPath()); } else { ret = file!=null ? SUtil.convertPathToRelative(file.getAbsolutePath()): null; } return ret; }
jarname = convertPathToRelative(jarname); return "jar:"+jarname+filename; filename = convertPathToRelative(filename);
@Classname("getRemoteFile") public IFuture<FileData> execute(IInternalAccess ia) { try { return new Future<FileData>(new FileData(new File(SUtil.convertPathToRelative(path)))); } catch(Exception e) { // Protect remote platform from execution errors. Thread.dumpStack(); e.printStackTrace(); return new Future<FileData>(e); } } });
@Classname("getRemoteFile") public IFuture<FileData> execute(IInternalAccess ia) { try { return new Future<FileData>(new FileData(new File(SUtil.convertPathToRelative(path)))); } catch(Exception e) { // Protect remote platform from execution errors. Thread.dumpStack(); e.printStackTrace(); return new Future<FileData>(e); } } });
String rel = SUtil.convertPathToRelative(abs);
file = new File(SUtil.convertPathToRelative(file.getAbsolutePath()));
if(adf!=null && lastfile!=null && SUtil.convertPathToRelative(adf).equals(SUtil.convertPathToRelative(lastfile)))
if(adf!=null && lastfile!=null && SUtil.convertPathToRelative(adf).equals(SUtil.convertPathToRelative(lastfile)))
@Classname("convertPathToRelative") public IIntermediateFuture<String> execute(IInternalAccess ia) { IntermediateFuture<String> ret = new IntermediateFuture<String>(); try { for(String path: paths) { ret.addIntermediateResult(SUtil.convertPathToRelative(path)); } ret.setFinished(); } catch(Exception e) { // Protect remote platform from execution errors. Thread.dumpStack(); e.printStackTrace(); ret.setException(e); } return ret; } });
@Classname("convertPathToRelative") public IIntermediateFuture<String> execute(IInternalAccess ia) { IntermediateFuture<String> ret = new IntermediateFuture<String>(); try { for(String path: paths) { ret.addIntermediateResult(SUtil.convertPathToRelative(path)); } ret.setFinished(); } catch(Exception e) { // Protect remote platform from execution errors. Thread.dumpStack(); e.printStackTrace(); ret.setException(e); } return ret; } });
/** * Create properties from rid. * @param The resource identifier. * @return rid The resource identifier properties. */ public Properties ridToProperties(IResourceIdentifier rid) { Properties ret = new Properties(); if(rid!=null && rid.getGlobalIdentifier()!=null) { ret.addProperty(new Property("gid_ri", rid.getGlobalIdentifier().getResourceId())); ret.addProperty(new Property("gid_vi", rid.getGlobalIdentifier().getVersionInfo())); // ret.addProperty(new Property("url", rid.getGlobalIdentifier().getRepositoryInfo())); } if(rid!=null && rid.getLocalIdentifier()!=null) { ret.addProperty(new Property("lid_url", SUtil.convertPathToRelative(rid.getLocalIdentifier().getUrl().toString()))); // todo: check if own platform cid? // ret.addProperty(new Property("lid_cid", rid.getLocalIdentifier().getComponentIdentifier())); } return ret; }
ret.addProperty(new Property("lid_url", SUtil.convertPathToRelative(rid.getLocalIdentifier().getUri().toString()))); local = true;