1
22
23 package com.liferay.documentlibrary.util;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portal.kernel.search.SearchException;
28
29 import java.io.File;
30 import java.io.InputStream;
31
32
38 public interface Hook {
39
40 public static final double DEFAULT_VERSION = 1.0;
41
42 public void addDirectory(long companyId, long repositoryId, String dirName)
43 throws PortalException, SystemException;
44
45 public void addFile(
46 long companyId, String portletId, long groupId, long repositoryId,
47 String fileName, String properties, File file)
48 throws PortalException, SystemException;
49
50 public void addFile(
51 long companyId, String portletId, long groupId, long repositoryId,
52 String fileName, String properties, byte[] byteArray)
53 throws PortalException, SystemException;
54
55 public void addFile(
56 long companyId, String portletId, long groupId, long repositoryId,
57 String fileName, String properties, InputStream is)
58 throws PortalException, SystemException;
59
60 public void checkRoot(long companyId) throws SystemException;
61
62 public void deleteDirectory(
63 long companyId, String portletId, long repositoryId, String dirName)
64 throws PortalException, SystemException;
65
66 public void deleteFile(
67 long companyId, String portletId, long repositoryId,
68 String fileName)
69 throws PortalException, SystemException;
70
71 public void deleteFile(
72 long companyId, String portletId, long repositoryId,
73 String fileName, double versionNumber)
74 throws PortalException, SystemException;
75
76 public byte[] getFile(long companyId, long repositoryId, String fileName)
77 throws PortalException, SystemException;
78
79 public byte[] getFile(
80 long companyId, long repositoryId, String fileName,
81 double versionNumber)
82 throws PortalException, SystemException;
83
84 public InputStream getFileAsStream(
85 long companyId, long repositoryId, String fileName)
86 throws PortalException, SystemException;
87
88 public InputStream getFileAsStream(
89 long companyId, long repositoryId, String fileName,
90 double versionNumber)
91 throws PortalException, SystemException;
92
93 public String[] getFileNames(
94 long companyId, long repositoryId, String dirName)
95 throws PortalException, SystemException;
96
97 public long getFileSize(
98 long companyId, long repositoryId, String fileName)
99 throws PortalException, SystemException;
100
101 public boolean hasFile(
102 long companyId, long repositoryId, String fileName,
103 double versionNumber)
104 throws PortalException, SystemException;
105
106 public void move(String srcDir, String destDir) throws SystemException;
107
108 public void reIndex(String[] ids) throws SearchException;
109
110 public void updateFile(
111 long companyId, String portletId, long groupId, long repositoryId,
112 String fileName, double versionNumber, String sourceFileName,
113 String properties, File file)
114 throws PortalException, SystemException;
115
116 public void updateFile(
117 long companyId, String portletId, long groupId, long repositoryId,
118 String fileName, double versionNumber, String sourceFileName,
119 String properties, byte[] byteArray)
120 throws PortalException, SystemException;
121
122 public void updateFile(
123 long companyId, String portletId, long groupId, long repositoryId,
124 String fileName, double versionNumber, String sourceFileName,
125 String properties, InputStream is)
126 throws PortalException, SystemException;
127
128 public void updateFile(
129 long companyId, String portletId, long groupId, long repositoryId,
130 long newRepositoryId, String fileName)
131 throws PortalException, SystemException;
132
133 }