4k4xs4pH1r3 / artemisa

Undocumented method found JAVA-D1001
Documentation
Minor
5 months ago6 months old
15		mistake = err; // save message
16	}
17
18	public String getError() {19		return mistake;20	}21
22}
46
47	}
48
49	public static SVGAbstractTranscoder getTranscoder(MimeType mime)50			throws SVGRasterizerException {5152		SVGAbstractTranscoder transcoder = null;5354		switch (mime) {55		case PNG:56			transcoder = new PNGTranscoder();57			break;58		case JPEG:59			transcoder = new JPEGTranscoder();60			transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,61					new Float(0.9));62			break;63		case PDF:64			transcoder = new PDFTranscoder();65			break;66		default:67			// do nothing68			break;69		}70		71		if(transcoder == null){72			throw new SVGRasterizerException("MimeType not supported");73		}74		75		return transcoder;76	}77}
22	private SVGRasterizer() {
23	}
24
25	public synchronized ByteArrayOutputStream transcode(26			ByteArrayOutputStream stream, String svg, MimeType mime, Float width)27			throws SVGRasterizerException, TranscoderException {2829		TranscoderInput input = new TranscoderInput(new StringReader(svg));30		// Create the transcoder output31		TranscoderOutput transOutput = new TranscoderOutput(stream);32		// get right Transcoder, depends on mime33		SVGAbstractTranscoder transcoder = SVGRasterizer.getTranscoder(mime);34		if (width != null) {35			/*36			 * If the raster image height is not provided (using the37			 * KEY_HEIGHT), the transcoder will compute the raster image height38			 * by keeping the aspect ratio of the SVG document.39			 */40			transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_WIDTH,41					width);42		}43		transcoder.transcode(input, transOutput);4445		return stream;4647	}48
49	public static SVGAbstractTranscoder getTranscoder(MimeType mime)
50			throws SVGRasterizerException {
27
28     public String getType() { return type; }
29
30     public static MimeType get(String type) {31    	  32          return lookup.get(type); 33     }34}
72
73	}
74
75	protected String selectEncoding(ServletRequest request) {76		return (this.encoding);77	}78
79}