public class SourceEntry extends Object
Modifier and Type | Field and Description |
---|---|
boolean |
active
active is a boolean flag that can be used to turn the source on or off at runtime.
|
boolean |
isZip
Indicates, that
url is a zip file and the resource is
inside the zip file. |
String |
name
Name is used as a namespace for color preferences and (currently) only
one file with a name can be loaded at a time.
|
String |
title
A title that can be used as menu entry.
|
String |
url
A URL can be anything that CachedFile understands, i.e.
|
String |
zipEntryPath
If
isZip is true, denotes the path inside the zip file. |
Constructor and Description |
---|
SourceEntry(SourceEntry e)
Constructs a new
SourceEntry . |
SourceEntry(String url,
boolean isZip,
String zipEntryPath,
String name,
String title,
boolean active)
Constructs a new
SourceEntry . |
SourceEntry(String url,
String name,
String title,
boolean active)
Constructs a new
SourceEntry . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getDisplayString()
String to show in menus and error messages.
|
String |
getFileNamePart()
Extracts file part from url, e.g.:
http://www.test.com/file.xml?format=text --> file.xml |
File |
getLocalSourceDir()
Return the source directory, only for local files.
|
String |
getPrefName()
the name / identifier that should be used to save custom color values
and similar stuff to the preference file
|
String |
getZipEntryDirName()
Returns the parent directory of the resource inside the zip file.
|
int |
hashCode() |
boolean |
isLocal()
Determines if this source denotes a file on a local filesystem.
|
String |
toString() |
public String url
public boolean isZip
url
is a zip file and the resource is
inside the zip file.public String zipEntryPath
isZip
is true, denotes the path inside the zip file.public String name
public boolean active
public SourceEntry(String url, boolean isZip, String zipEntryPath, String name, String title, boolean active)
SourceEntry
.url
- URL that CachedFile
understandsisZip
- if url is a zip file and the resource is inside the zip filezipEntryPath
- If isZip
is true
, denotes the path inside the zip filename
- Source nametitle
- title that can be used as menu entryactive
- boolean flag that can be used to turn the source on or off at runtimeurl
,
isZip
,
zipEntryPath
,
name
,
title
,
active
public SourceEntry(String url, String name, String title, boolean active)
SourceEntry
.url
- URL that CachedFile
understandsname
- Source nametitle
- title that can be used as menu entryactive
- boolean flag that can be used to turn the source on or off at runtimeurl
,
name
,
title
,
active
public SourceEntry(SourceEntry e)
SourceEntry
.e
- existing source entry to copypublic String getDisplayString()
public String getFileNamePart()
http://www.test.com/file.xml?format=text --> file.xml
public String getPrefName()
public boolean isLocal()
true
if the source is a local filepublic File getLocalSourceDir()
null
if this file isn't local, or does not have a parentpublic String getZipEntryDirName()