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, String[] tagsEntries, 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, String[] tagsEntries,
53 byte[] bytes)
54 throws PortalException, SystemException;
55
56 public void addFile(
57 long companyId, String portletId, long groupId, long repositoryId,
58 String fileName, String properties, String[] tagsEntries,
59 InputStream is)
60 throws PortalException, SystemException;
61
62 public void checkRoot(long companyId) throws SystemException;
63
64 public void deleteDirectory(
65 long companyId, String portletId, long repositoryId, String dirName)
66 throws PortalException, SystemException;
67
68 public void deleteFile(
69 long companyId, String portletId, long repositoryId,
70 String fileName)
71 throws PortalException, SystemException;
72
73 public void deleteFile(
74 long companyId, String portletId, long repositoryId,
75 String fileName, double versionNumber)
76 throws PortalException, SystemException;
77
78 public byte[] getFile(long companyId, long repositoryId, String fileName)
79 throws PortalException, SystemException;
80
81 public byte[] getFile(
82 long companyId, long repositoryId, String fileName,
83 double versionNumber)
84 throws PortalException, SystemException;
85
86 public InputStream getFileAsStream(
87 long companyId, long repositoryId, String fileName)
88 throws PortalException, SystemException;
89
90 public InputStream getFileAsStream(
91 long companyId, long repositoryId, String fileName,
92 double versionNumber)
93 throws PortalException, SystemException;
94
95 public String[] getFileNames(
96 long companyId, long repositoryId, String dirName)
97 throws PortalException, SystemException;
98
99 public long getFileSize(
100 long companyId, long repositoryId, String fileName)
101 throws PortalException, SystemException;
102
103 public boolean hasFile(
104 long companyId, long repositoryId, String fileName,
105 double versionNumber)
106 throws PortalException, SystemException;
107
108 public void move(String srcDir, String destDir) throws SystemException;
109
110 public void reIndex(String[] ids) throws SearchException;
111
112 public void updateFile(
113 long companyId, String portletId, long groupId, long repositoryId,
114 String fileName, double versionNumber, String sourceFileName,
115 String properties, String[] tagsEntries, File file)
116 throws PortalException, SystemException;
117
118 public void updateFile(
119 long companyId, String portletId, long groupId, long repositoryId,
120 String fileName, double versionNumber, String sourceFileName,
121 String properties, String[] tagsEntries, byte[] bytes)
122 throws PortalException, SystemException;
123
124 public void updateFile(
125 long companyId, String portletId, long groupId, long repositoryId,
126 String fileName, double versionNumber, String sourceFileName,
127 String properties, String[] tagsEntries, InputStream is)
128 throws PortalException, SystemException;
129
130 public void updateFile(
131 long companyId, String portletId, long groupId, long repositoryId,
132 long newRepositoryId, String fileName)
133 throws PortalException, SystemException;
134
135 }