/*
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * 
 * $Id: OnWriteExceptionThrowingStringBean.java 69513 2013-01-15 12:49:59Z supol $ 
 */

package com.sun.ts.tests.jaxrs.ee.rs.ext.interceptor.writer.writerinterceptorcontext;

import java.io.IOException;

import javax.ws.rs.WebApplicationException;

import com.sun.ts.tests.jaxrs.api.rs.ext.interceptor.TemplateInterceptorBody;
import com.sun.ts.tests.jaxrs.common.provider.StringBean;

public class OnWriteExceptionThrowingStringBean extends StringBean {

	public OnWriteExceptionThrowingStringBean(String header) {
		super(header);
	}

	@Override
	public String get() {
		String header = super.get();
		if (header.equals(TemplateInterceptorBody.WAE))
			return header;
		else
			throw new WebApplicationException(new IOException(header));
	}
}
