Package: DefaultResourceFile
DefaultResourceFile
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DefaultResourceFile(ResourceFileSystem, Path) |
|
|
|
|
|
||||||||||||||||||||
as(As.Type) |
|
|
|
|
|
||||||||||||||||||||
as(Class) |
|
|
|
|
|
||||||||||||||||||||
asBytes() |
|
|
|
|
|
||||||||||||||||||||
asMany(As.Type) |
|
|
|
|
|
||||||||||||||||||||
asMany(Class) |
|
|
|
|
|
||||||||||||||||||||
asText(String) |
|
|
|
|
|
||||||||||||||||||||
copyTo(ResourceFile) |
|
|
|
|
|
||||||||||||||||||||
createFolder(String) |
|
|
|
|
|
||||||||||||||||||||
delete() |
|
|
|
|
|
||||||||||||||||||||
findChildren() |
|
|
|
|
|
||||||||||||||||||||
getFileSystem() |
|
|
|
|
|
||||||||||||||||||||
getInputStream() |
|
|
|
|
|
||||||||||||||||||||
getLatestModificationTime() |
|
|
|
|
|
||||||||||||||||||||
getMimeType() |
|
|
|
|
|
||||||||||||||||||||
getName() |
|
|
|
|
|
||||||||||||||||||||
getParent() |
|
|
|
|
|
||||||||||||||||||||
getPath() |
|
|
|
|
|
||||||||||||||||||||
isData() |
|
|
|
|
|
||||||||||||||||||||
isFolder() |
|
|
|
|
|
||||||||||||||||||||
maybeAs(As.Type) |
|
|
|
|
|
||||||||||||||||||||
maybeAs(Class) |
|
|
|
|
|
||||||||||||||||||||
toFile() |
|
|
|
|
|
Coverage
1: /*
2: * #%L
3: * *********************************************************************************************************************
4: *
5: * NorthernWind - lightweight CMS
6: * http://northernwind.tidalwave.it - git clone https://bitbucket.org/tidalwave/northernwind-src.git
7: * %%
8: * Copyright (C) 2011 - 2023 Tidalwave s.a.s. (http://tidalwave.it)
9: * %%
10: * *********************************************************************************************************************
11: *
12: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
13: * the License. You may obtain a copy of the License at
14: *
15: * http://www.apache.org/licenses/LICENSE-2.0
16: *
17: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
18: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
19: * specific language governing permissions and limitations under the License.
20: *
21: * *********************************************************************************************************************
22: *
23: *
24: * *********************************************************************************************************************
25: * #L%
26: */
27: package it.tidalwave.northernwind.frontend.filesystem.impl;
28:
29: import javax.annotation.Nonnull;
30: import java.io.File;
31: import java.io.FileNotFoundException;
32: import java.io.IOException;
33: import java.io.InputStream;
34: import java.nio.file.Path;
35: import it.tidalwave.northernwind.core.model.ResourceFile;
36: import it.tidalwave.northernwind.core.model.ResourceFileSystem;
37: import it.tidalwave.northernwind.core.model.ResourcePath;
38: import it.tidalwave.util.As;
39: import java.time.ZonedDateTime;
40: import lombok.Delegate;
41: import lombok.Getter;
42: import lombok.RequiredArgsConstructor;
43:
44: /***********************************************************************************************************************
45: *
46: * @author Fabrizio Giudici
47: * @version $Id$
48: *
49: **********************************************************************************************************************/
50: @RequiredArgsConstructor
51: public class DefaultResourceFile implements ResourceFile
52: {
53: @Getter @Nonnull
54: private final ResourceFileSystem fileSystem;
55:
56: @Nonnull
57: private final Path delegate;
58:
59: @Delegate
60: private final As asSupport = As.forObject(this);
61:
62: @Override @Nonnull
63: public String getName()
64: {
65: return delegate.getFileName().toString();
66: }
67:
68: @Override @Nonnull
69: public ResourcePath getPath()
70: {
71: return ResourcePath.of(delegate.toAbsolutePath().toString());
72: }
73:
74: @Override
75: public boolean isFolder()
76: {
77: return delegate.toFile().isDirectory();
78: }
79:
80: @Override
81: public boolean isData()
82: {
83: return delegate.toFile().isFile();
84: }
85:
86: @Override
87: public Finder findChildren()
88: {
89: throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
90: }
91:
92: @Override
93: public String getMimeType()
94: {
95: throw new UnsupportedOperationException("Not supported yet.");
96: }
97:
98: @Override
99: public InputStream getInputStream()
100: throws FileNotFoundException
101: {
102: throw new UnsupportedOperationException("Not supported yet.");
103: }
104:
105: @Override
106: public String asText(String encoding)
107: throws IOException
108: {
109: throw new UnsupportedOperationException("Not supported yet.");
110: }
111:
112: @Override
113: public byte[] asBytes()
114: throws IOException
115: {
116: throw new UnsupportedOperationException("Not supported yet.");
117: }
118:
119: @Override
120: public ZonedDateTime getLatestModificationTime()
121: {
122: throw new UnsupportedOperationException("Not supported yet.");
123: }
124:
125: @Override
126: public ResourceFile getParent()
127: {
128: throw new UnsupportedOperationException("Not supported yet.");
129: }
130:
131: @Override @Nonnull
132: public File toFile()
133: {
134: return delegate.toFile();
135: }
136:
137: @Override
138: public void delete()
139: throws IOException
140: {
141: throw new UnsupportedOperationException("Not supported yet.");
142: }
143:
144: @Override
145: public ResourceFile createFolder(String name)
146: throws IOException
147: {
148: throw new UnsupportedOperationException("Not supported yet.");
149: }
150:
151: @Override
152: public void copyTo(ResourceFile targetFolder)
153: throws IOException
154: {
155: throw new UnsupportedOperationException("Not supported yet.");
156: }
157: }