Gabriele Zigurella
2 anni fa
12 ha cambiato i file con 260 aggiunte e 0 eliminazioni
@ -0,0 +1,22 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<classpath> |
||||||
|
<classpathentry kind="src" path="docroot/WEB-INF/src"/> |
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> |
||||||
|
<attributes> |
||||||
|
<attribute name="owner.project.facets" value="java"/> |
||||||
|
</attributes> |
||||||
|
</classpathentry> |
||||||
|
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.liferay.ide.eclipse.server.tomcat.runtimeClasspathProvider/Liferay v6.2 CE (Tomcat 7)"> |
||||||
|
<attributes> |
||||||
|
<attribute name="owner.project.facets" value="jst.web"/> |
||||||
|
</attributes> |
||||||
|
</classpathentry> |
||||||
|
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> |
||||||
|
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> |
||||||
|
<classpathentry kind="con" path="com.liferay.ide.eclipse.server.plugin.container/hook"> |
||||||
|
<attributes> |
||||||
|
<attribute name="org.eclipse.jst.component.nondependency" value=""/> |
||||||
|
</attributes> |
||||||
|
</classpathentry> |
||||||
|
<classpathentry kind="output" path="docroot/WEB-INF/classes"/> |
||||||
|
</classpath> |
@ -0,0 +1,36 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<projectDescription> |
||||||
|
<name>fake-advanced-filesystem-hook</name> |
||||||
|
<comment></comment> |
||||||
|
<projects> |
||||||
|
</projects> |
||||||
|
<buildSpec> |
||||||
|
<buildCommand> |
||||||
|
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name> |
||||||
|
<arguments> |
||||||
|
</arguments> |
||||||
|
</buildCommand> |
||||||
|
<buildCommand> |
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name> |
||||||
|
<arguments> |
||||||
|
</arguments> |
||||||
|
</buildCommand> |
||||||
|
<buildCommand> |
||||||
|
<name>org.eclipse.wst.common.project.facet.core.builder</name> |
||||||
|
<arguments> |
||||||
|
</arguments> |
||||||
|
</buildCommand> |
||||||
|
<buildCommand> |
||||||
|
<name>org.eclipse.wst.validation.validationbuilder</name> |
||||||
|
<arguments> |
||||||
|
</arguments> |
||||||
|
</buildCommand> |
||||||
|
</buildSpec> |
||||||
|
<natures> |
||||||
|
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> |
||||||
|
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> |
||||||
|
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> |
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature> |
||||||
|
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> |
||||||
|
</natures> |
||||||
|
</projectDescription> |
@ -0,0 +1,6 @@ |
|||||||
|
<?xml version="1.0"?> |
||||||
|
<!DOCTYPE project> |
||||||
|
|
||||||
|
<project name="fake-advanced-filesystem-hook" basedir="."> |
||||||
|
<import file="C:/liferay-sviluppo/6_2/liferay-plugins-sdk-6.2-ee-sp11/hooks/build-common-hook.xml" /> |
||||||
|
</project> |
@ -0,0 +1,3 @@ |
|||||||
|
Manifest-Version: 1.0 |
||||||
|
Class-Path: |
||||||
|
|
@ -0,0 +1,5 @@ |
|||||||
|
/commons-logging.jar |
||||||
|
/log4j.jar |
||||||
|
/util-bridges.jar |
||||||
|
/util-java.jar |
||||||
|
/util-taglib.jar |
@ -0,0 +1,9 @@ |
|||||||
|
<?xml version="1.0"?> |
||||||
|
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd"> |
||||||
|
|
||||||
|
<hook> |
||||||
|
<service> |
||||||
|
<service-type>com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService</service-type> |
||||||
|
<service-impl>com.liferay.portlet.documentlibrary.service.FakeDLFileEntryLocalServiceImpl</service-impl> |
||||||
|
</service> |
||||||
|
</hook> |
@ -0,0 +1,11 @@ |
|||||||
|
name=Sample Wrapper |
||||||
|
module-group-id=liferay |
||||||
|
module-incremental-version=1 |
||||||
|
tags= |
||||||
|
short-description=This hook shows how to wrap Liferay's core services and models. |
||||||
|
long-description= |
||||||
|
change-log= |
||||||
|
page-url=http://www.liferay.com |
||||||
|
author=Liferay, Inc. |
||||||
|
licenses=LGPL |
||||||
|
liferay-versions=6.2.0+ |
@ -0,0 +1,9 @@ |
|||||||
|
bundle=false |
||||||
|
category= |
||||||
|
demo-url= |
||||||
|
dependent-apps= |
||||||
|
labs=true |
||||||
|
marketplace=false |
||||||
|
public=true |
||||||
|
support-url= |
||||||
|
supported=false |
@ -0,0 +1 @@ |
|||||||
|
<?xml version="1.0"?> |
@ -0,0 +1,2 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<javadocs></javadocs> |
@ -0,0 +1,153 @@ |
|||||||
|
package com.liferay.portlet.documentlibrary.service; |
||||||
|
|
||||||
|
import com.liferay.portal.kernel.exception.PortalException; |
||||||
|
import com.liferay.portal.kernel.exception.SystemException; |
||||||
|
import com.liferay.portal.kernel.log.Log; |
||||||
|
import com.liferay.portal.kernel.log.LogFactoryUtil; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
import java.io.FileInputStream; |
||||||
|
import java.io.IOException; |
||||||
|
import java.io.InputStream; |
||||||
|
|
||||||
|
public class FakeDLFileEntryLocalServiceImpl extends DLFileEntryLocalServiceWrapper { |
||||||
|
|
||||||
|
@Override |
||||||
|
public File getFile(long userId, long fileEntryId, String version, |
||||||
|
boolean incrementCounter, int increment) throws PortalException, |
||||||
|
SystemException { |
||||||
|
File file = null; |
||||||
|
try{ |
||||||
|
file = super.getFile(userId, fileEntryId, version, incrementCounter, increment); |
||||||
|
} catch (Exception e){ |
||||||
|
try { |
||||||
|
file = File.createTempFile("fakeFile", ".fake"); |
||||||
|
} catch (IOException io) { |
||||||
|
_log.error("Fallback fake advanced filesystem failed to create temporary file"); |
||||||
|
} |
||||||
|
} |
||||||
|
return file; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public File getFile(long userId, long fileEntryId, String version, |
||||||
|
boolean incrementCounter) throws PortalException, SystemException { |
||||||
|
File file = null; |
||||||
|
try{ |
||||||
|
file = super.getFile(userId, fileEntryId, version, incrementCounter); |
||||||
|
} catch (Exception e){ |
||||||
|
try { |
||||||
|
file = File.createTempFile("fakeFile", ".fake"); |
||||||
|
} catch (IOException io) { |
||||||
|
_log.error("Fallback fake advanced filesystem failed to create temporary file"); |
||||||
|
} |
||||||
|
} |
||||||
|
return file; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public InputStream getFileAsStream(long userId, long fileEntryId, |
||||||
|
String version, boolean incrementCounter, int increment) |
||||||
|
throws PortalException, SystemException { |
||||||
|
InputStream stream = null; |
||||||
|
try{ |
||||||
|
stream = super.getFileAsStream(userId, fileEntryId, version, incrementCounter, increment); |
||||||
|
} catch (Exception e){ |
||||||
|
try { |
||||||
|
stream = new FileInputStream(File.createTempFile("fakeFile", ".fake")); |
||||||
|
} catch (IOException io) { |
||||||
|
_log.error("Fallback fake advanced filesystem failed to create temporary file"); |
||||||
|
} |
||||||
|
} |
||||||
|
return stream; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public InputStream getFileAsStream(long userId, long fileEntryId, |
||||||
|
String version, boolean incrementCounter) throws PortalException, |
||||||
|
SystemException { |
||||||
|
InputStream stream = null; |
||||||
|
try{ |
||||||
|
stream = super.getFileAsStream(userId, fileEntryId, version, incrementCounter); |
||||||
|
} catch (Exception e){ |
||||||
|
try { |
||||||
|
stream = new FileInputStream(File.createTempFile("fakeFile", ".fake")); |
||||||
|
} catch (IOException io) { |
||||||
|
_log.error("Fallback fake advanced filesystem failed to create temporary file"); |
||||||
|
} |
||||||
|
} |
||||||
|
return stream; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public InputStream getFileAsStream(long userId, long fileEntryId, |
||||||
|
String version) throws PortalException, SystemException { |
||||||
|
InputStream stream = null; |
||||||
|
try{ |
||||||
|
stream = super.getFileAsStream(userId, fileEntryId, version); |
||||||
|
} catch (Exception e){ |
||||||
|
try { |
||||||
|
stream = new FileInputStream(File.createTempFile("fakeFile", ".fake")); |
||||||
|
} catch (IOException io) { |
||||||
|
_log.error("Fallback fake advanced filesystem failed to create temporary file"); |
||||||
|
} |
||||||
|
} |
||||||
|
return stream; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public InputStream getFileAsStream(long fileEntryId, String version, |
||||||
|
boolean incrementCounter, int increment) throws PortalException, |
||||||
|
SystemException { |
||||||
|
InputStream stream = null; |
||||||
|
try{ |
||||||
|
stream = super.getFileAsStream(fileEntryId, version, incrementCounter, increment); |
||||||
|
} catch (Exception e){ |
||||||
|
try { |
||||||
|
stream = new FileInputStream(File.createTempFile("fakeFile", ".fake")); |
||||||
|
} catch (IOException io) { |
||||||
|
_log.error("Fallback fake advanced filesystem failed to create temporary file"); |
||||||
|
} |
||||||
|
} |
||||||
|
return stream; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public InputStream getFileAsStream(long fileEntryId, String version, |
||||||
|
boolean incrementCounter) throws PortalException, SystemException { |
||||||
|
InputStream stream = null; |
||||||
|
try{ |
||||||
|
stream = super.getFileAsStream(fileEntryId, version, incrementCounter); |
||||||
|
} catch (Exception e){ |
||||||
|
try { |
||||||
|
stream = new FileInputStream(File.createTempFile("fakeFile", ".fake")); |
||||||
|
} catch (IOException io) { |
||||||
|
_log.error("Fallback fake advanced filesystem failed to create temporary file"); |
||||||
|
} |
||||||
|
} |
||||||
|
return stream; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public InputStream getFileAsStream(long fileEntryId, String version) |
||||||
|
throws PortalException, SystemException { |
||||||
|
InputStream stream = null; |
||||||
|
try{ |
||||||
|
stream = super.getFileAsStream(fileEntryId, version); |
||||||
|
} catch (Exception e){ |
||||||
|
try { |
||||||
|
stream = new FileInputStream(File.createTempFile("fakeFile", ".fake")); |
||||||
|
} catch (IOException io) { |
||||||
|
_log.error("Fallback fake advanced filesystem failed to create temporary file"); |
||||||
|
} |
||||||
|
} |
||||||
|
return stream; |
||||||
|
} |
||||||
|
|
||||||
|
public FakeDLFileEntryLocalServiceImpl( |
||||||
|
DLFileEntryLocalService dlFileEntryLocalService) { |
||||||
|
super(dlFileEntryLocalService); |
||||||
|
} |
||||||
|
|
||||||
|
Log _log = LogFactoryUtil.getLog(this.getClass()); |
||||||
|
} |
@ -0,0 +1,3 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> |
||||||
|
</web-app> |
Caricamento…
Reference in new issue