Last change
on this file since 193 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
|
File size:
778 bytes
|
Line | |
---|
1 | package com.framsticks.communication; |
---|
2 | |
---|
3 | |
---|
4 | import javax.annotation.Nonnull; |
---|
5 | |
---|
6 | import com.framsticks.params.Source; |
---|
7 | // import com.framsticks.util.lang.Strings; |
---|
8 | import com.framsticks.util.lang.Strings; |
---|
9 | |
---|
10 | /** |
---|
11 | * @author Piotr Sniegowski |
---|
12 | */ |
---|
13 | public final class File { |
---|
14 | protected final String path; |
---|
15 | protected final Source content; |
---|
16 | |
---|
17 | public File(@Nonnull String path, @Nonnull Source content) { |
---|
18 | // assert Strings.notEmpty(path); |
---|
19 | this.path = path; |
---|
20 | this.content = content; |
---|
21 | } |
---|
22 | |
---|
23 | public String getPath() { |
---|
24 | return path; |
---|
25 | } |
---|
26 | |
---|
27 | public Source getContent() { |
---|
28 | return content; |
---|
29 | } |
---|
30 | |
---|
31 | @Override |
---|
32 | public String toString() { |
---|
33 | StringBuilder b = new StringBuilder(); |
---|
34 | if (Strings.notEmpty(path)) { |
---|
35 | b.append(path).append(": "); |
---|
36 | } |
---|
37 | b.append(content.toString()); |
---|
38 | return b.toString(); |
---|
39 | } |
---|
40 | |
---|
41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.