Removed old files

This commit is contained in:
Ziver Koc 2018-10-15 21:44:59 +02:00
parent 43c26ed063
commit 969bcbdf19
7 changed files with 15 additions and 150 deletions

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="/Test/lib/commons-cli-1.2.jar"/>
<classpathentry kind="lib" path="/Test/lib/slf4j-api-1.6.4.jar"/>
<classpathentry kind="lib" path="C:/Users/Ziver/Documents/Programmering/Java/libs/xuggler/xuggle-xuggler-5.4.jar" sourcepath="C:/Users/Ziver/Documents/Programmering/Java/libs/xuggler/xuggle-xuggler-5.4.jar"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web;#system#"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="build/classes"/>
</classpath>

View file

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Zallery</name>
<comment></comment>
<projects>
<project>ZUtil</project>
</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>

View file

@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Zallery" >
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
<!--common properties-->
<property name="gitRoot" value="." />
<property name="srcDir" value="${gitRoot}/src" />
<property name="libDir" value="${gitRoot}/lib" />
<property name="libExpDir" value="${gitRoot}/WebContent/WEB-INF/lib" />
<property name="outputRoot" value="${gitRoot}/build" />
<property name="buildDir" value="${outputRoot}/production" />
<property name="releaseDir" value="${outputRoot}/release" />
<!-- Deployment properties -->
<property name="tomcat.url" value="http://localhost:8080/manager/text" />
<property name="tomcat.user" value="" />
<property name="tomcat.pass" value="" />
<property name="catalina.home" value="/usr/share/tomcat7"/>
<!--define standard arguments for javac-->
<presetdef name="javac">
<javac includeantruntime="false" />
</presetdef>
<!-- ________________________ CLASSPATHS ________________________ -->
<!--classpath included when building-->
<path id="classpath.build">
<fileset dir="${libDir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${libExpDir}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${buildDir}" />
</path>
<!-- ________________________ EXECUTION TARGETS ________________________ -->
<!-- ________________________ BUILD TARGETS ________________________ -->
<!--clean all build paths-->
<target name="clean">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${outputRoot}" includes="**/*" />
</delete>
</target>
<!--build product code-->
<target name="build">
<mkdir dir="${buildDir}" />
<get src="http://ci.koc.se/jenkins/job/Zutil/lastSuccessfulBuild/artifact/build/release/Zutil.jar" dest="${libExpDir}" verbose="true" usetimestamp="true"/>
<javac target="1.7" srcdir="${srcDir}" destdir="${buildDir}" debug="yes" debugLevel="lines,vars,source">
<classpath refid="classpath.build" />
<include name="**/*.java" />
</javac>
</target>
<target name="package" depends="build">
<war destfile="${releaseDir}/Zallery.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir="WebContent" />
<!-- <fileset dir="${srcDir}"/> -->
<lib dir="WebContent/WEB-INF/lib" />
<classes dir="${buildDir}" />
</war>
</target>
<import file="${catalina.home}/bin/catalina-tasks.xml" optional="true"/>
<target name="deploy" depends="package">
<deploy url="${tomcat.url}"
username="${tomcat.user}"
password="${tomcat.pass}"
path="/Zallery"
update="true"
war="file:${releaseDir}/Zallery.war" />
<!-- Workaround as tomcat deletes the webapp context file from conf dir -->
<copy file="/var/lib/tomcat7/conf/Catalina/localhost/Zallery.xml_orig"
toFile="/var/lib/tomcat7/conf/Catalina/localhost/Zallery.xml" />
</target>
</project>

View file

@ -2,6 +2,7 @@ package zall.bean;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.SQLException;
@ -83,10 +84,10 @@ public class Image extends Media {
}
/**
* Returns the file for the image, and generates a thumbnail if the specified size is missing
*
* @param size is the size of the image
* @return the path to the image file, and generates a thumbnail if the specified size is missing
*/
@Override
public File getFile(Size size) throws IOException {
if (fileName != null) {
switch (size) {
@ -116,9 +117,9 @@ public class Image extends Media {
ImageIO.write(image, IMAGE_FORMAT, file);
}
else if (!orgFile.exists())
logger.severe("Original image file missing: \"" + file.getAbsolutePath() + "\"");
logger.severe("Original image file missing: '" + file.getAbsolutePath() + "'");
else if (orgFile.canRead())
logger.severe("Can not read original image file: \"" + file.getAbsolutePath() + "\"");
logger.severe("Can not read original image file: '" + file.getAbsolutePath() + "'");
}
return file;
}

View file

@ -1,5 +1,7 @@
package zall.bean;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.SQLException;
import java.sql.Timestamp;
@ -128,5 +130,10 @@ public abstract class Media extends DBBean implements Comparable<Media> {
*/
public abstract String getFileExtension(Size size);
public File getFile(Size size) throws IOException {
return ResourceManager.getFile(this, size);
}
public abstract Type getType();
}

View file

@ -44,7 +44,7 @@ public class ResourceManager {
private static final Logger logger = LogUtil.getLogger();
/**
* @param media is the media to find on the filesystem
* @param media is the media to find on the filesystem.
* @param size specifies the size of the media.
* @return a File object that points to the physical file on the disk, or null.
*/
@ -77,7 +77,7 @@ public class ResourceManager {
}
// Add the filename
File mediaFile = new File(folder, media.getFileName());
File mediaFile = new File(folder, media.getFileName() + "." + media.getFileExtension(size));
logger.finest("File path: " + mediaFile.getAbsolutePath());
return mediaFile;

View file

@ -56,7 +56,7 @@ public class ContentServlet extends ZalleryServlet {
if (request.getParameter("size") != null)
size = Media.Size.valueOf(request.getParameter("size").toUpperCase());
File file = ResourceManager.getFile(media, size);
File file = media.getFile(size);
String extension = media.getFileExtension(size);
if (request.getParameter("download") != null)