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 import java.util.Date;
33
34
40 public interface Hook {
41
42 public static final double DEFAULT_VERSION = 1.0;
43
44 public void addDirectory(long companyId, long repositoryId, String dirName)
45 throws PortalException, SystemException;
46
47 public void addFile(
48 long companyId, String portletId, long groupId, long repositoryId,
49 String fileName, long fileEntryId, String properties,
50 Date modifiedDate, String[] tagsEntries, byte[] bytes)
51 throws PortalException, SystemException;
52
53 public void addFile(
54 long companyId, String portletId, long groupId, long repositoryId,
55 String fileName, long fileEntryId, String properties,
56 Date modifiedDate, String[] tagsEntries, File file)
57 throws PortalException, SystemException;
58
59 public void addFile(
60 long companyId, String portletId, long groupId, long repositoryId,
61 String fileName, long fileEntryId, String properties,
62 Date modifiedDate, String[] tagsEntries, InputStream is)
63 throws PortalException, SystemException;
64
65 public void checkRoot(long companyId) throws SystemException;
66
67 public void deleteDirectory(
68 long companyId, String portletId, long repositoryId, String dirName)
69 throws PortalException, SystemException;
70
71 public void deleteFile(
72 long companyId, String portletId, long repositoryId,
73 String fileName)
74 throws PortalException, SystemException;
75
76 public void deleteFile(
77 long companyId, String portletId, long repositoryId,
78 String fileName, double versionNumber)
79 throws PortalException, SystemException;
80
81 public byte[] getFile(long companyId, long repositoryId, String fileName)
82 throws PortalException, SystemException;
83
84 public byte[] getFile(
85 long companyId, long repositoryId, String fileName,
86 double versionNumber)
87 throws PortalException, SystemException;
88
89 public InputStream getFileAsStream(
90 long companyId, long repositoryId, String fileName)
91 throws PortalException, SystemException;
92
93 public InputStream getFileAsStream(
94 long companyId, long repositoryId, String fileName,
95 double versionNumber)
96 throws PortalException, SystemException;
97
98 public String[] getFileNames(
99 long companyId, long repositoryId, String dirName)
100 throws PortalException, SystemException;
101
102 public long getFileSize(
103 long companyId, long repositoryId, String fileName)
104 throws PortalException, SystemException;
105
106 public boolean hasFile(
107 long companyId, long repositoryId, String fileName,
108 double versionNumber)
109 throws PortalException, SystemException;
110
111 public void move(String srcDir, String destDir) throws SystemException;
112
113 public void reIndex(String[] ids) throws SearchException;
114
115 public void updateFile(
116 long companyId, String portletId, long groupId, long repositoryId,
117 String fileName, double versionNumber, String sourceFileName,
118 long fileEntryId, String properties, Date modifiedDate,
119 String[] tagsEntries, byte[] bytes)
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 long fileEntryId, String properties, Date modifiedDate,
126 String[] tagsEntries, File file)
127 throws PortalException, SystemException;
128
129 public void updateFile(
130 long companyId, String portletId, long groupId, long repositoryId,
131 String fileName, double versionNumber, String sourceFileName,
132 long fileEntryId, String properties, Date modifiedDate,
133 String[] tagsEntries, InputStream is)
134 throws PortalException, SystemException;
135
136 public void updateFile(
137 long companyId, String portletId, long groupId, long repositoryId,
138 long newRepositoryId, String fileName, long fileEntryId)
139 throws PortalException, SystemException;
140
141 }