Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/util/FileUtils.java =================================================================== diff -u --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/util/FileUtils.java (revision 0) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/util/FileUtils.java (revision 2445d0ae722db3ba0495a6506b02c5fe5f70e551) @@ -0,0 +1,36 @@ +package org.lamsfoundation.lams.tool.forum.util; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.File; + +/** + * Created by IntelliJ IDEA. + * User: conradb + * Date: 8/06/2005 + * Time: 15:42:19 + * To change this template use File | Settings | File Templates. + */ +public class FileUtils { + private static FileUtils util; + + private FileUtils() { + + } + + public static FileUtils getInstance() { + if (util == null) { + util = new FileUtils(); + } + return util; + } + + public static byte[] getBytes(File file) throws FileNotFoundException, Exception { + byte[] byteArray = new byte[(int) file.length()]; + FileInputStream stream = new FileInputStream(file); + stream.read(byteArray); + stream.close(); + return byteArray; + } + +} Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/util/ForumConstants.java =================================================================== diff -u --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/util/ForumConstants.java (revision 0) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/util/ForumConstants.java (revision 2445d0ae722db3ba0495a6506b02c5fe5f70e551) @@ -0,0 +1,12 @@ +package org.lamsfoundation.lams.tool.forum.util; + +/** + * Created by IntelliJ IDEA. + * User: conradb + * Date: 14/06/2005 + * Time: 10:33:00 + * To change this template use File | Settings | File Templates. + */ +public interface ForumConstants { + public final static int MAX_FILE_SIZE = 250 * 1000; +}