18 package org.turro.elephant.impl.context.vc;
21 import java.util.Date;
22 import org.turro.string.ObjectString;
29 public static final String
31 VALID_LOCALE_REGEXP =
"(_[a-zA-Z]{2})?(_[a-zA-Z]{2})?(_[a-zA-Z]{2})?";
33 private String fullName, name, extension, lang, author, version;
34 private Date creation, modification;
35 private boolean lastEntry =
false;
44 private void createFields() {
45 fullName = file.getName();
46 String parts[] = fullName.split(
"\\.");
47 int lParts = parts.length;
49 extension = parts[lParts - 1];
50 if(parts[lParts - 2].indexOf(
'_') > -1) {
54 String tmp[] = parts[lParts - 2].split(
"\\_");
55 for(
int i = tmp.length - 1; i > 0; i--) {
56 if(tmp[i].length() == 2) {
57 lang =
"_" + tmp[i] +
getLang();
60 rest =
"_" + tmp[i] + rest;
63 parts[lParts - 2] = tmp[0] + rest;
67 if(name.matches(
"[0-9]*")) {
68 creation = (Date) ObjectString.parseString(name.substring(3),
69 ObjectString.COMPRESSED_DATE_PATTERN, Date.class,
false);
74 if(version.matches(
"[0-9]*")) {
75 modification = (Date) ObjectString.parseString(version,
76 ObjectString.COMPRESSED_DATE_PATTERN, Date.class,
false);
119 this.lastEntry = lastEntry;
127 return "wiki".equals(extension);
static final String VALID_EXT_REGEXP
boolean isRenderedVersion()
void setLastEntry(boolean lastEntry)
FileProperties(File file)