/** * Notifies all proxy subscribers of a proxy setting change. */ public void notifyProxySubscribers() { for (ProxySubscriber subscriber : proxySubscribers) { subscriber.onProxyChange(this); } }
/** * {@inheritDoc} */ @Override protected Map<SignatureType, SignatureFileInfo> doInBackground() throws SignatureManagerException { signatureFileInfos = signatureManager.getLatestSignatureFiles(); return signatureFileInfos; }
/** * @return a nnew instance */ public static ProxySettings newInstance() { return new ProxySettings(); } /**
/** * Executes this action. * @param parent the parent window */ public void execute(Window parent) { File f = new File(fileName); try { SignatureFileInfo info = signatureManager.install(type, f, useAsDefault); String message = String.format("Signature file %s has been installed", info.getFile().getName()); JOptionPane.showMessageDialog(parent, message, "Signature file installed", JOptionPane.INFORMATION_MESSAGE); } catch (SignatureFileException e) { JOptionPane.showMessageDialog(parent, e.getMessage(), "Error installing signature file", JOptionPane.ERROR_MESSAGE); } }
/** * {@inheritDoc} */ @Override protected Map<SignatureType, SignatureFileInfo> doInBackground() throws SignatureManagerException { Map<SignatureType, SignatureFileInfo> downloaded = new HashMap<SignatureType, SignatureFileInfo>(); for (SignatureFileInfo update : updates) { if (!update.hasError()) { downloaded.put(update.getType(), signatureManager.downloadLatest(update.getType())); } } return downloaded; }
/** * {@inheritDoc} */ @Override public String getLocalizedMessage() { return String.format("Error updating signature file:\n%s\nReason: %s - %s", getMessage(), getCauseType(), getCauseMessage()); } }
private int getLatestVersionForType(SignatureType type, Map<String, SignatureFileInfo> signatures) { int result = 0; for (String key : signatures.keySet()) { SignatureFileInfo info = signatures.get(key); if (info.getVersion() > result) { result = info.getVersion(); } } return result; }
/** * * @return a map of available signature files. */ public Map<SignatureType, SortedMap<String, SignatureFileInfo>> list() { return signatureManager.getAvailableSignatureFiles(); }
private static SignatureFileInfo forBinarySigFile(File file, SignatureInfoParser parser) throws SignatureFileException { final SignatureFileInfo signatureFileInfo = parser.parse(file); signatureFileInfo.setFile(file); return signatureFileInfo; }
/** * @return The cause message. */ public String getCauseMessage() { return getCause().getCause().getMessage(); }
@Override public String getLocalizedMessage() { return String.format("Error updating signature file:\n%s", getMessage()); }
/** * {@inheritDoc} */ @Override protected Map<SignatureType, SignatureFileInfo> doInBackground() throws SignatureManagerException { Map<SignatureType, SignatureFileInfo> downloaded = new HashMap<SignatureType, SignatureFileInfo>(); for (SignatureFileInfo update : updates) { if (!update.hasError()) { downloaded.put(update.getType(), signatureManager.downloadLatest(update.getType())); } } return downloaded; }
/** * {@inheritDoc} */ @Override public String getLocalizedMessage() { return String.format("Error updating signature file:\n%s\nReason: %s - %s", getMessage(), getCauseType(), getCauseMessage()); } }
/** * @return a new instance */ public static ProxySettings newInstance() { return new ProxySettings(); } /**
private int getLatestVersionForType(SignatureType type, Map<String, SignatureFileInfo> signatures) { int result = 0; for (String key : signatures.keySet()) { SignatureFileInfo info = signatures.get(key); if (info.getVersion() > result) { result = info.getVersion(); } } return result; }
/** * {@inheritDoc} */ @Override protected Map<SignatureType, SignatureFileInfo> doInBackground() throws SignatureManagerException { signatureFileInfos = signatureManager.getLatestSignatureFiles(); return signatureFileInfos; }
/** * * @return a map of available signature files. */ public Map<SignatureType, SortedMap<String, SignatureFileInfo>> list() { return signatureManager.getAvailableSignatureFiles(); }
private static SignatureFileInfo forBinarySigFile(final Path file, final SignatureInfoParser parser) throws SignatureFileException { final SignatureFileInfo signatureFileInfo = parser.parse(file); signatureFileInfo.setFile(file); return signatureFileInfo; }
/** * @return The cause message. */ public String getCauseMessage() { return getCause().getCause().getMessage(); }
/** * Notifies all proxy subscribers of a proxy setting change. */ public void notifyProxySubscribers() { for (ProxySubscriber subscriber : proxySubscribers) { subscriber.onProxyChange(this); } }