/** * Loads a SerializationPolicy from an input stream. * * @param inputStream stream to load from * @return a {@link SerializationPolicy} loaded from the input stream * * @throws IOException if an error occurs while reading the stream * @throws ParseException if the input stream is not properly formatted * @throws ClassNotFoundException if a class specified in the serialization * policy cannot be loaded * * @deprecated see {@link #loadFromStream(InputStream, List)} */ @Deprecated public static SerializationPolicy loadFromStream(InputStream inputStream) throws IOException, ParseException, ClassNotFoundException { List<ClassNotFoundException> classNotFoundExceptions = new ArrayList<ClassNotFoundException>(); SerializationPolicy serializationPolicy = loadFromStream(inputStream, classNotFoundExceptions); if (!classNotFoundExceptions.isEmpty()) { // Just report the first failure. throw classNotFoundExceptions.get(0); } return serializationPolicy; }
/** * Attempts to read a policy from a given InputStream and logs any errors. * * @param sourceName names the source of the input stream for log messages. * @return the policy or null if unavailable. */ private static SerializationPolicy readPolicy(InputStream in, String sourceName, Logger logger) { try { List<ClassNotFoundException> errs = new ArrayList<ClassNotFoundException>(); SerializationPolicy policy = SerializationPolicyLoader.loadFromStream(in, errs); logger.logInfo("Downloaded serialization policy from " + sourceName); if (!errs.isEmpty()) { logMissingClasses(logger, errs); } return policy; } catch (ParseException e) { logger.logError("Can't parse serialization policy from " + sourceName, e); return null; } catch (IOException e) { logger.logError("Can't read serialization policy from " + sourceName, e); return null; } finally { try { in.close(); } catch (IOException e) { logger.logError("Can't close serialization policy url: " + sourceName, e); } } }
if (is != null) { try { serializationPolicy = SerializationPolicyLoader.loadFromStream(is, null); } catch (ParseException e) {
/** * Loads a SerializationPolicy from an input stream. * * @param inputStream stream to load from * @return a {@link SerializationPolicy} loaded from the input stream * * @throws IOException if an error occurs while reading the stream * @throws ParseException if the input stream is not properly formatted * @throws ClassNotFoundException if a class specified in the serialization * policy cannot be loaded * * @deprecated see {@link #loadFromStream(InputStream, List)} */ @Deprecated public static SerializationPolicy loadFromStream(InputStream inputStream) throws IOException, ParseException, ClassNotFoundException { List<ClassNotFoundException> classNotFoundExceptions = new ArrayList<ClassNotFoundException>(); SerializationPolicy serializationPolicy = loadFromStream(inputStream, classNotFoundExceptions); if (!classNotFoundExceptions.isEmpty()) { // Just report the first failure. throw classNotFoundExceptions.get(0); } return serializationPolicy; }
/** * Loads a SerializationPolicy from an input stream. * * @param inputStream stream to load from * @return a {@link SerializationPolicy} loaded from the input stream * * @throws IOException if an error occurs while reading the stream * @throws ParseException if the input stream is not properly formatted * @throws ClassNotFoundException if a class specified in the serialization * policy cannot be loaded * * @deprecated see {@link #loadFromStream(InputStream, List)} */ @Deprecated public static SerializationPolicy loadFromStream(InputStream inputStream) throws IOException, ParseException, ClassNotFoundException { List<ClassNotFoundException> classNotFoundExceptions = new ArrayList<ClassNotFoundException>(); SerializationPolicy serializationPolicy = loadFromStream(inputStream, classNotFoundExceptions); if (!classNotFoundExceptions.isEmpty()) { // Just report the first failure. throw classNotFoundExceptions.get(0); } return serializationPolicy; }
if (is != null) { try { serializationPolicy = SerializationPolicyLoader.loadFromStream(is, null); } catch (ParseException e) { context.log(
if (is != null) { try { serializationPolicy = SerializationPolicyLoader.loadFromStream(is, null); break; } catch (ParseException e) {
try { serializationPolicy = SerializationPolicyLoader .loadFromStream(is, null); } catch (ParseException e) { context.log(
try { in = new FileInputStream(policyFile); return SerializationPolicyLoader.loadFromStream(in, null); } catch (IOException e) { log.error("Failed to read gwt serialization policy file for module " + moduleId + " [ " + filename + " ]", e);
/** * Attempts to read a policy from a given InputStream and logs any errors. * * @param sourceName names the source of the input stream for log messages. * @return the policy or null if unavailable. */ private static SerializationPolicy readPolicy(InputStream in, String sourceName, Logger logger) { try { List<ClassNotFoundException> errs = new ArrayList<ClassNotFoundException>(); SerializationPolicy policy = SerializationPolicyLoader.loadFromStream(in, errs); logger.logInfo("Downloaded serialization policy from " + sourceName); if (!errs.isEmpty()) { logMissingClasses(logger, errs); } return policy; } catch (ParseException e) { logger.logError("Can't parse serialization policy from " + sourceName, e); return null; } catch (IOException e) { logger.logError("Can't read serialization policy from " + sourceName, e); return null; } finally { try { in.close(); } catch (IOException e) { logger.logError("Can't close serialization policy url: " + sourceName, e); } } }
/** * Attempts to read a policy from a given InputStream and logs any errors. * * @param sourceName names the source of the input stream for log messages. * @return the policy or null if unavailable. */ private static SerializationPolicy readPolicy(InputStream in, String sourceName, Logger logger) { try { List<ClassNotFoundException> errs = new ArrayList<ClassNotFoundException>(); SerializationPolicy policy = SerializationPolicyLoader.loadFromStream(in, errs); logger.logInfo("Downloaded serialization policy from " + sourceName); if (!errs.isEmpty()) { logMissingClasses(logger, errs); } return policy; } catch (ParseException e) { logger.logError("Can't parse serialization policy from " + sourceName, e); return null; } catch (IOException e) { logger.logError("Can't read serialization policy from " + sourceName, e); return null; } finally { try { in.close(); } catch (IOException e) { logger.logError("Can't close serialization policy url: " + sourceName, e); } } }
serializationPolicy = SerializationPolicyLoader.loadFromStream(is, errorList);
if (is != null) { try { serializationPolicy = SerializationPolicyLoader.loadFromStream(is, null); } catch (ParseException e) {
.loadFromStream(is, null); } catch (ParseException e)
if (is != null) { try { serializationPolicy = SerializationPolicyLoader.loadFromStream(is, null); } catch (ParseException e) {
if (is != null) { try { serializationPolicy = SerializationPolicyLoader.loadFromStream(is, null); } catch (ParseException e) {
serializationPolicy = SerializationPolicyLoader.loadFromStream(is, null); } catch (ParseException e) { LOG.error("ERROR: Failed to parse the policy file '" + m_serializationPolicyPath + "'", e);