SerializerArtifact.java
3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.jcr.RepositoryException
* org.apache.commons.io.output.DeferredFileOutputStream
*/
package com.day.jcr.vault.fs;
import com.day.jcr.vault.fs.api.AccessType;
import com.day.jcr.vault.fs.api.Artifact;
import com.day.jcr.vault.fs.api.ArtifactType;
import com.day.jcr.vault.fs.api.DumpContext;
import com.day.jcr.vault.fs.api.ExportArtifact;
import com.day.jcr.vault.fs.api.SerializationType;
import com.day.jcr.vault.fs.api.VaultInputSource;
import com.day.jcr.vault.fs.io.Serializer;
import com.day.jcr.vault.util.TempFileInputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.jcr.RepositoryException;
import org.apache.commons.io.output.DeferredFileOutputStream;
public class SerializerArtifact
implements ExportArtifact {
private final Serializer serializer;
private final long lastModified;
public SerializerArtifact(Artifact parent, String name, String ext, ArtifactType type, Serializer serializer, long lastModified) {
throw new UnsupportedOperationException("No longer supported. use the org.apache.jackrabbit.vault counterpart.");
}
public AccessType getPreferredAccess() {
return AccessType.SPOOL;
}
public SerializationType getSerializationType() {
return this.serializer.getType();
}
public void spool(OutputStream out) throws IOException, RepositoryException {
this.serializer.writeContent(out);
}
public InputStream getInputStream() throws IOException, RepositoryException {
DeferredFileOutputStream out = new DeferredFileOutputStream(8192, "vlttmp", ".tmp", null);
this.spool((OutputStream)out);
out.close();
if (out.isInMemory()) {
return new ByteArrayInputStream(out.getData());
}
return new TempFileInputStream(out.getFile());
}
public VaultInputSource getInputSource() throws IOException, RepositoryException {
InputStream in2;
long size;
InputStream in2;
DeferredFileOutputStream out = new DeferredFileOutputStream(8192, "vlttmp", ".tmp", null);
this.spool((OutputStream)out);
out.close();
if (out.isInMemory()) {
in2 = new ByteArrayInputStream(out.getData());
size = out.getData().length;
} else {
in2 = new TempFileInputStream(out.getFile());
size = out.getFile().length();
}
return new VaultInputSource(){
public String getSystemId() {
return SerializerArtifact.this.getRelativePath();
}
public InputStream getByteStream() {
return in2;
}
public long getContentLength() {
return size;
}
public long getLastModified() {
return SerializerArtifact.this.lastModified;
}
};
}
public String getContentType() {
throw new UnsupportedOperationException("No longer supported. use the org.apache.jackrabbit.vault counterpart.");
}
public long getContentLength() {
return -1;
}
public long getLastModified() {
return this.lastModified;
}
public String getPlatformPath() {
return null;
}
public String getExtension() {
return null;
}
public String getRelativePath() {
return null;
}
public ArtifactType getType() {
return null;
}
public void dump(DumpContext ctx, boolean isLast) {
}
}