diff -ruN -X exclude dspace-1.3.2-source/build.xml symlink_dspace-1.3.2-01/build.xml
--- dspace-1.3.2-source/build.xml	2005-08-04 21:38:40.000000000 +0200
+++ symlink_dspace-1.3.2-01/build.xml	2006-06-05 16:15:27.000000000 +0200
@@ -228,8 +228,18 @@
     <jar jarfile="${dspace.dir}/lib/dspace.jar"
          basedir="build/classes" />
   </target>
-  
-  
+
+	<!-- Symlink DSpace -->
+	<!-- Vlastimil Krejcir, krejcir@ics.muni.cz -->
+	<!-- Institute of Computer Science, Masaryk University -->
+	<!-- 2006 -->
+	<!-- install dspace.jar only -->
+	<target name="install_jar" depends="compile">
+		<mkdir dir="${dspace.dir}/lib"/>
+		<jar jarfile="${dspace.dir}/lib/dspace.jar" basedir="build/classes" />
+	</target>
+	<!-- end mofification by krejvl -->
+
   <!-- ============================================================= -->
   <!-- Fresh install of config files                                 -->
   <!-- ============================================================= -->
diff -ruN -X exclude dspace-1.3.2-source/src/org/dspace/app/itemimport/ItemImport.java symlink_dspace-1.3.2-01/src/org/dspace/app/itemimport/ItemImport.java
--- dspace-1.3.2-source/src/org/dspace/app/itemimport/ItemImport.java	2005-07-12 13:26:13.000000000 +0200
+++ symlink_dspace-1.3.2-01/src/org/dspace/app/itemimport/ItemImport.java	2006-06-02 12:45:29.000000000 +0200
@@ -1046,6 +1046,76 @@
 
             bs.setName(fileName);
 
+						/*
+						 * Symlink DSpace
+						 *
+						 * Created by Vlastimil Krejcir, krejcir@ics.muni.cz
+						 * Institute of Computer Science, Masaryk University in Brno
+						 * 
+						 * 2006
+						 * 
+						 */
+		
+						if (! fileName.equals("license.txt")) {
+							String realFilePath = "";
+							String realFileSize = "";
+							String realFileName = "";
+
+							fileName = bs.getPath(c);
+
+							//System.out.println("\t");
+ 							File f = new File(fileName);
+
+  						// neexistuje-li soubor vyvolej vyjimku
+  						//if (! f.exists()) { throw new IOException(); }
+
+  						if (f.exists()) {
+
+								FileReader fr = new FileReader(f);
+								BufferedReader in = new BufferedReader(fr);
+
+								realFilePath = in.readLine();
+
+								realFileSize = String.valueOf(new File(realFilePath).length());
+								realFileName = realFilePath.substring(realFilePath.lastIndexOf("/") + 1);
+
+								fr.close();
+  						}
+
+
+							File rf = new File(realFilePath);
+							
+							
+							if (! rf.exists()) {
+								System.out.println("WARNING: Target file " + realFilePath + " does not exist or you don't have permissions to access it!");
+								System.out.println("WARNING: Symlink will probably fail - see the log file \"dspace_ln.log\"");
+							}
+
+							String[] toRun1 = {"/bin/sh", "-c", "rm -v -f " + fileName + " >> dspace_rm.log 2>&1"};
+  						String[] toRun2 = {"/bin/sh", "-c", "ln -v  -s " + realFilePath + " " + fileName + " >> dspace_ln.log 2>&1"};
+  					
+							try {
+								Process proc1 = Runtime.getRuntime().exec(toRun1);
+								proc1.waitFor();
+  							Process proc2 = Runtime.getRuntime().exec(toRun2);
+								proc2.waitFor();
+							} catch (InterruptedException e) {
+								e.printStackTrace();
+							}
+							
+  						bs.setName(realFileName);
+  						bs.setSource(realFilePath);
+  						bs.setSize(Integer.valueOf(realFileSize).intValue());
+
+						}
+						
+						/*
+						 * 
+						 * End of Symlink DSpace
+						 *
+						 */
+
+						
             // Identify the format
             // FIXME - guessing format guesses license.txt incorrectly as a text
             // file format!
diff -ruN -X exclude dspace-1.3.2-source/src/org/dspace/app/webui/servlet/SubmitServlet.java symlink_dspace-1.3.2-01/src/org/dspace/app/webui/servlet/SubmitServlet.java
--- dspace-1.3.2-source/src/org/dspace/app/webui/servlet/SubmitServlet.java	2005-08-25 19:20:27.000000000 +0200
+++ symlink_dspace-1.3.2-01/src/org/dspace/app/webui/servlet/SubmitServlet.java	2006-06-02 09:12:43.000000000 +0200
@@ -83,6 +83,27 @@
 import org.dspace.workflow.WorkflowItem;
 import org.dspace.workflow.WorkflowManager;
 
+/*
+ * Symlink DSpace
+ *
+ * Created by Vlastimil Krejcir, krejcir@ics.muni.cz
+ * Institute of Computer Science, Masaryk University in Brno
+ * 
+ * 2006
+ * 
+ */
+
+import java.io.FileReader;
+import java.io.BufferedReader;
+import java.io.*;
+
+/*
+ * 
+ * End of Symlink DSpace
+ *
+ */
+
+
 /**
  * Submission servlet for DSpace. Handles the initial submission of items, as
  * well as the editing of items further down the line.
@@ -1056,6 +1077,57 @@
                     b.setSource(wrapper.getFilesystemName("file"));
                     b.setDescription(wrapper.getParameter("description"));
 
+										/*
+										 * Symlink DSpace
+										 *
+										 * Created by Vlastimil Krejcir, krejcir@ics.muni.cz
+										 * Institute of Computer Science, Masaryk University in Brno
+										 * 
+										 * 2006
+										 * 
+										 */
+
+										String realFilePath = "";
+										String realFileSize = "";
+										String realFileName = "";
+										String toRun1 = "";
+										String toRun2 = "";
+
+										String fileName = b.getPath(context);
+
+										File f = new File(fileName);
+										
+										if (f.exists()) {
+											
+											FileReader fr = new FileReader(f);
+											BufferedReader in = new BufferedReader(fr);
+											
+											realFilePath = in.readLine();
+											realFileSize = 
+												String.valueOf(new File(realFilePath).length());
+											realFileName = 
+												realFilePath.substring(realFilePath.lastIndexOf("/")+1);
+											
+											fr.close();
+										}
+										
+										Runtime curr = Runtime.getRuntime();
+										toRun1 = "rm -f " + fileName;
+										toRun2 = "ln -s " + realFilePath + " " + fileName;
+										curr.exec(toRun1);
+										curr.exec(toRun2);
+
+										b.setName(realFileName);
+										b.setSource(realFilePath);
+										b.setSize(Integer.valueOf(realFileSize).intValue());
+
+										/*
+										 * 
+										 * End of Symlink DSpace
+										 *
+										 */
+
+										
                     // Identify the format
                     bf = FormatIdentifier.guessFormat(context, b);
                     b.setFormat(bf);
diff -ruN -X exclude dspace-1.3.2-source/src/org/dspace/app/webui/servlet/admin/EditItemServlet.java symlink_dspace-1.3.2-01/src/org/dspace/app/webui/servlet/admin/EditItemServlet.java
--- dspace-1.3.2-source/src/org/dspace/app/webui/servlet/admin/EditItemServlet.java	2005-04-20 16:22:30.000000000 +0200
+++ symlink_dspace-1.3.2-01/src/org/dspace/app/webui/servlet/admin/EditItemServlet.java	2006-06-02 09:12:41.000000000 +0200
@@ -77,6 +77,27 @@
 import org.dspace.handle.HandleManager;
 import org.dspace.search.DSIndexer;
 
+/*
+ * Symlink DSpace
+ *
+ * Created by Vlastimil Krejcir, krejcir@ics.muni.cz
+ * Institute of Computer Science, Masaryk University in Brno
+ * 
+ * 2006
+ * 
+ */
+
+import java.io.FileReader;
+import java.io.BufferedReader;
+import java.io.*;
+
+/*
+ * 
+ * End of Symlink DSpace
+ *
+ */
+
+
 /**
  * Servlet for editing and deleting (expunging) items
  * 
@@ -629,6 +650,55 @@
         b.setName(noPath);
         b.setSource(wrapper.getFilesystemName("file"));
 
+				/*
+				 * Symlink DSpace
+				 *
+				 * Created by Vlastimil Krejcir, krejcir@ics.muni.cz
+				 * Institute of Computer Science, Masaryk University in Brno
+				 * 
+				 * 2006
+				 * 
+				 */
+
+				String realFilePath = "";
+				String realFileSize = "";
+				String realFileName = "";
+				String toRun1 = "";
+				String toRun2 = "";
+
+				String fileName = b.getPath(context);
+
+				File f = new File(fileName);
+										
+				if (f.exists()) {
+											
+					FileReader fr = new FileReader(f);
+					BufferedReader in = new BufferedReader(fr);
+											
+					realFilePath = in.readLine();
+					realFileSize = String.valueOf(new File(realFilePath).length());
+					realFileName = 
+						realFilePath.substring(realFilePath.lastIndexOf("/")+1);
+											
+					fr.close();
+				}
+										
+				Runtime curr = Runtime.getRuntime();
+				toRun1 = "rm -f " + fileName;
+				toRun2 = "ln -s " + realFilePath + " " + fileName;
+				curr.exec(toRun1);
+				curr.exec(toRun2);
+
+				b.setName(realFileName);
+				b.setSource(realFilePath);
+				b.setSize(Integer.valueOf(realFileSize).intValue());
+
+				/*
+				 * 
+				 * End of Symlink DSpace
+				 *
+				 */
+				
         // Identify the format
         BitstreamFormat bf = FormatIdentifier.guessFormat(context, b);
         b.setFormat(bf);
diff -ruN -X exclude dspace-1.3.2-source/src/org/dspace/content/Bitstream.java symlink_dspace-1.3.2-01/src/org/dspace/content/Bitstream.java
--- dspace-1.3.2-source/src/org/dspace/content/Bitstream.java	2005-04-20 16:22:33.000000000 +0200
+++ symlink_dspace-1.3.2-01/src/org/dspace/content/Bitstream.java	2006-06-01 15:37:09.000000000 +0200
@@ -57,6 +57,30 @@
 import org.dspace.storage.rdbms.TableRow;
 import org.dspace.storage.rdbms.TableRowIterator;
 
+/*
+ * Symlink DSpace
+ *
+ * Created by Vlastimil Krejcir, krejcir@ics.muni.cz
+ * Institute of Computer Science, Masaryk University in Brno
+ * 
+ * 2006
+ * 
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.math.BigInteger;
+import edu.sdsc.grid.io.GeneralFile;
+
+/*
+ * 
+ * End of Symlink DSpace
+ *
+ */
+
+
 /**
  * Class representing bitstreams stored in the DSpace system.
  * <P>
@@ -350,6 +374,73 @@
         return bRow.getStringColumn("checksum_algorithm");
     }
 
+		/* Symlink DSpace
+		 *
+     * Created by Vlastimil Krejcir, krejcir@ics.muni.cz
+     * Institute of Computer Science, Masaryk University in Brno
+     * 
+     * 2006
+     * 
+     */
+
+		/**
+		 * Get the complete filesystem path including the file name for the 
+     * bistream
+		 *
+		 * @param context
+		 * 						The current context
+		 * 
+		 * @return The path
+		 */
+		public String getPath(Context context) throws SQLException, IOException
+		{
+			TableRow bbb = DatabaseManager.find(context, "bitstream", getID());
+			int storeNumber = bbb.getIntColumn("store_number");
+			GeneralFile store = BitstreamStorageManager.getAssetstore(storeNumber);
+			String id = bbb.getStringColumn("internal_id");
+
+			BigInteger bigint = new BigInteger(id);
+
+			int directoryLevels = BitstreamStorageManager.getDirectoryLevels();
+			int digitsPerLevel = BitstreamStorageManager.getDigitsPerLevel();
+			
+			StringBuffer result = new StringBuffer().append(store.getCanonicalPath());
+			for (int i = 0; i < directoryLevels; i++) {
+				int digits = i * digitsPerLevel;
+				result.append(File.separator).append(
+				id.substring(digits, digits + digitsPerLevel));
+      }
+
+			String theName = result.append(File.separator).append(id).toString();
+
+			return theName;
+		}
+
+		/**
+		 * Set the size of the bitstream
+		 *
+		 * @param size
+		 * 					The size of bitstream
+		 *
+		 */
+		public void setSize(int size)
+		{
+			if ("oracle".equals(ConfigurationManager.getProperty("db.name")))
+			{
+				bRow.setColumn("size_bytes", size);
+			}
+
+			// default is column "size" for postgres
+			bRow.setColumn("size", size);
+		}
+		
+		/*
+		 * 
+		 * End of Symlink DSpace
+		 *
+		 */
+
+		
     /**
      * Get the size of the bitstream
      * 
diff -ruN -X exclude dspace-1.3.2-source/src/org/dspace/storage/bitstore/BitstreamStorageManager.java symlink_dspace-1.3.2-01/src/org/dspace/storage/bitstore/BitstreamStorageManager.java
--- dspace-1.3.2-source/src/org/dspace/storage/bitstore/BitstreamStorageManager.java	2005-04-20 16:23:18.000000000 +0200
+++ symlink_dspace-1.3.2-01/src/org/dspace/storage/bitstore/BitstreamStorageManager.java	2006-06-01 13:39:22.000000000 +0200
@@ -370,6 +370,56 @@
         return bitstream_id;
     }
 
+
+		/*
+ 		 * Symlink DSpace
+ 		 *
+ 		 * Created by Vlastimil Krejcir, krejcir@ics.muni.cz
+ 		 * Institute of Computer Science, Masaryk University in Brno
+ 		 * 
+ 		 * 2006
+ 		 * 
+ 		 */
+
+		/** 
+		 * Get the bistream's assetstore.
+		 *
+		 * @param storeNumber
+		 * 							The bitstream's assetstore number
+		 *
+		 * @return assetstore File
+		 */
+		public static GeneralFile getAssetstore(int storeNumber)
+		{
+			return assetStores[storeNumber];
+		}
+
+		/**
+		 * Get directory levels constant
+		 *
+		 * @return directory levels
+		 */
+		public static int getDirectoryLevels()
+		{
+			return directoryLevels;
+		}
+
+		/**
+		 * Get digits per level constant
+		 *
+		 * @return digits per level
+		 */
+		public static int getDigitsPerLevel()
+		{
+			return digitsPerLevel;
+		}
+
+		/*
+ 		 * 
+ 		 * End of Symlink DSpace
+ 		 *
+ 		 */
+		
 	/**
 	 * Register a bitstream already in storage.
 	 *

