FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lesscss-java/src/main/java/org/lesscss/FileResource.java at master · schuth/lesscss-java · GitHub
schuth
lesscss-java
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
lesscss-java
/
src
/
main
/
java
/
org
/
lesscss
/
FileResource.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
49 lines (39 loc) · 1.06 KB
Breadcrumbs
lesscss-java
/
src
/
main
/
java
/
org
/
lesscss
/
FileResource.java
Copy path
File metadata and controls
49 lines (39 loc) · 1.06 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
org
.
lesscss
;
import
java
.
io
.
File
;
import
java
.
io
.
FileInputStream
;
import
java
.
io
.
IOException
;
import
java
.
io
.
InputStream
;
/**
* File based implementation of {@link Resource}.
*
* @author Anton Pechinsky
*/
public
class
FileResource
implements
Resource
{
private
File
file
;
public
FileResource
(
File
file
) {
if
(
file
==
null
) {
throw
new
IllegalArgumentException
(
"File must not be null!"
);
}
this
.
file
=
file
;
}
public
boolean
exists
() {
return
file
.
exists
();
}
public
InputStream
getInputStream
()
throws
IOException
{
return
new
FileInputStream
(
file
);
}
public
long
lastModified
() {
return
file
.
lastModified
();
}
public
Resource
createRelative
(
String
relativePath
) {
File
relativeFile
=
new
File
(
file
.
getParentFile
(),
relativePath
);
return
new
FileResource
(
relativeFile
);
}
@
Override
public
String
toString
() {
return
file
.
getAbsolutePath
();
}
public
String
getName
() {
return
file
.
getAbsolutePath
();
}
}
Back
|
FazBrowse Home
|
New Git URL