Author: mwringe
Date: 2009-08-29 17:59:04 -0400 (Sat, 29 Aug 2009)
New Revision: 128
Removed:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.merge-left.r13522
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.merge-right.r13523
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.working
Modified:
components/pc/trunk/portlet/
Log:
minor svn clean up, remove files that shouldn't have been committed and add target to
svn ignore.
Property changes on: components/pc/trunk/portlet
___________________________________________________________________
Name: svn:ignore
+ target
Deleted:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.merge-left.r13522
===================================================================
---
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.merge-left.r13522 2009-08-29
21:50:55 UTC (rev 127)
+++
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.merge-left.r13522 2009-08-29
21:59:04 UTC (rev 128)
@@ -1,103 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.jsr168.api;
-
-import org.jboss.portal.portlet.invocation.ResourceInvocation;
-import org.jboss.portal.portlet.invocation.response.ContentResponse;
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.cache.CacheLevel;
-import org.jboss.portal.portlet.cache.CacheControl;
-
-import javax.portlet.ResourceResponse;
-import javax.portlet.PortletURL;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ResourceResponseImpl extends MimeResponseImpl implements ResourceResponse
-{
-
- /** . */
- private final CacheLevel cacheability;
-
- public ResourceResponseImpl(ResourceInvocation invocation, PortletRequestImpl preq)
- {
- super(invocation, preq);
-
- //
- this.cacheability = invocation.getCacheLevel();
- }
-
- public void setLocale(Locale locale)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setCharacterEncoding(String s)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setContentLength(int i)
- {
- throw new UnsupportedOperationException();
- }
-
- public PortletURL createActionURL()
- {
- if (cacheability != CacheLevel.PAGE)
- {
- throw new IllegalStateException("Cannot create action URL because the
current cache level " + cacheability +
- " is not " + CacheLevel.PAGE);
- }
-
- //
- return super.createActionURL();
- }
-
- public PortletURL createRenderURL()
- {
- if (cacheability != CacheLevel.PAGE)
- {
- throw new IllegalStateException("Cannot create render URL because the
current cache level " + cacheability +
- " is not " + CacheLevel.PAGE);
- }
-
- //
- return super.createRenderURL();
- }
-
- protected ContentResponse createMarkupResponse(ResponseProperties properties,
Map<String, Object> attributeMap, String contentType, byte[] bytes, String chars,
CacheControl cacheControl)
- {
- return new ContentResponse(
- properties,
- attributeMap,
- contentType,
- bytes,
- chars,
- cacheControl);
- }
-}
Deleted:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.merge-right.r13523
===================================================================
---
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.merge-right.r13523 2009-08-29
21:50:55 UTC (rev 127)
+++
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.merge-right.r13523 2009-08-29
21:59:04 UTC (rev 128)
@@ -1,103 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.jsr168.api;
-
-import org.jboss.portal.portlet.api.invocation.ResourceInvocation;
-import org.jboss.portal.portlet.api.invocation.response.ContentResponse;
-import org.jboss.portal.portlet.api.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.api.cache.CacheLevel;
-import org.jboss.portal.portlet.api.cache.CacheControl;
-
-import javax.portlet.ResourceResponse;
-import javax.portlet.PortletURL;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ResourceResponseImpl extends MimeResponseImpl implements ResourceResponse
-{
-
- /** . */
- private final CacheLevel cacheability;
-
- public ResourceResponseImpl(ResourceInvocation invocation, PortletRequestImpl preq)
- {
- super(invocation, preq);
-
- //
- this.cacheability = invocation.getCacheLevel();
- }
-
- public void setLocale(Locale locale)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setCharacterEncoding(String s)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setContentLength(int i)
- {
- throw new UnsupportedOperationException();
- }
-
- public PortletURL createActionURL()
- {
- if (cacheability != CacheLevel.PAGE)
- {
- throw new IllegalStateException("Cannot create action URL because the
current cache level " + cacheability +
- " is not " + CacheLevel.PAGE);
- }
-
- //
- return super.createActionURL();
- }
-
- public PortletURL createRenderURL()
- {
- if (cacheability != CacheLevel.PAGE)
- {
- throw new IllegalStateException("Cannot create render URL because the
current cache level " + cacheability +
- " is not " + CacheLevel.PAGE);
- }
-
- //
- return super.createRenderURL();
- }
-
- protected ContentResponse createMarkupResponse(ResponseProperties properties,
Map<String, Object> attributeMap, String contentType, byte[] bytes, String chars,
CacheControl cacheControl)
- {
- return new ContentResponse(
- properties,
- attributeMap,
- contentType,
- bytes,
- chars,
- cacheControl);
- }
-}
Deleted:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.working
===================================================================
---
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.working 2009-08-29
21:50:55 UTC (rev 127)
+++
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceResponseImpl.java.working 2009-08-29
21:59:04 UTC (rev 128)
@@ -1,145 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.jsr168.api;
-
-import org.jboss.portal.common.net.media.ContentType;
-import org.jboss.portal.common.net.media.MediaType;
-import org.jboss.portal.common.net.media.Parameter;
-import org.jboss.portal.portlet.invocation.ResourceInvocation;
-import org.jboss.portal.portlet.invocation.response.ContentResponse;
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.cache.CacheLevel;
-import org.jboss.portal.portlet.cache.CacheControl;
-
-import javax.portlet.ResourceResponse;
-import javax.portlet.PortletURL;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ResourceResponseImpl extends MimeResponseImpl implements ResourceResponse
-{
-
- /** . */
- private final CacheLevel cacheability;
-
- public ResourceResponseImpl(ResourceInvocation invocation, PortletRequestImpl preq)
- {
- super(invocation, preq);
-
- //
- this.cacheability = invocation.getCacheLevel();
- }
-
- public void setLocale(Locale locale)
- {
- // TODO: setLocale should also set the character encoding according to the mapping
done in web.xml
-
- if (locale == null)
- {
- throw new IllegalArgumentException("Locale cannot be null");
- }
- if ("".equals(locale.getCountry()))
- {
- addProperty("Content-Language", locale.getLanguage());
- }
- else
- {
- addProperty("Content-Language", locale.getLanguage() + "-"
+ locale.getCountry());
- }
- }
-
- public void setCharacterEncoding(String s)
- {
- List<Parameter> parameters = new ArrayList<Parameter>();
- MediaType mediaType = null;
-
- String contentTypeString = getContentType();
- if (contentTypeString != null)
- {
- ContentType contentType = ContentType.create(contentTypeString);
- mediaType = contentType.getMediaType();
- for (Parameter parameter : contentType.getParameters())
- {
- if (!parameter.getName().trim().toLowerCase().equals("charset"))
- {
- parameters.add(parameter);
- }
- }
- }
- else
- {
- // Default to "text/html"
- mediaType = MediaType.TEXT_HTML;
- }
- parameters.add(new Parameter("charset", s));
-
- setContentType(new ContentType(mediaType, parameters).getValue());
- }
-
- public void setContentLength(int i)
- {
- addProperty("Content-Length", "" + i);
- }
-
- public PortletURL createActionURL()
- {
- if (cacheability != CacheLevel.PAGE)
- {
- throw new IllegalStateException("Cannot create action URL because the
current cache level " + cacheability +
- " is not " + CacheLevel.PAGE);
- }
-
- //
- return super.createActionURL();
- }
-
- public PortletURL createRenderURL()
- {
- if (cacheability != CacheLevel.PAGE)
- {
- throw new IllegalStateException("Cannot create render URL because the
current cache level " + cacheability +
- " is not " + CacheLevel.PAGE);
- }
-
- //
- return super.createRenderURL();
- }
-
- protected ContentResponse createMarkupResponse(ResponseProperties properties,
Map<String, Object> attributeMap, String contentType, byte[] bytes, String chars,
CacheControl cacheControl)
- {
- return new ContentResponse(
- properties,
- attributeMap,
- contentType,
- bytes,
- chars,
- cacheControl);
- }
-}