commit | author | age
|
ef2fb2
|
1 |
/* |
U |
2 |
neon-image - Image extensions to Neon |
|
3 |
Copyright (C) 2024 Ulrich Hilger |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Affero General Public License as |
|
7 |
published by the Free Software Foundation, either version 3 of the |
|
8 |
License, or (at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU Affero General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Affero General Public License |
|
16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
package de.uhilger.neon.image; |
|
19 |
|
|
20 |
/** |
|
21 |
* Datei-Referenz für http-image und http-cm |
|
22 |
* |
|
23 |
* Die Klasse gehoert eigentlich eher zu http-cm, ist aber hier |
|
24 |
* implementiert, weil http-cm vermutlich ohnehin gemeinsam mit |
|
25 |
* http-image genutzt wird, aber nicht so zwingend umgekehrt. |
|
26 |
* |
|
27 |
* @author Ulrich Hilger |
|
28 |
* @version 1, 11. Mai 2021 |
|
29 |
*/ |
|
30 |
public class Datei { |
|
31 |
|
|
32 |
public static final String TYP_DATEI = "datei"; |
|
33 |
public static final String TYP_ORDNER = "ordner"; |
|
34 |
|
|
35 |
public static final String TK_DATEI = "icon-doc-inv"; |
|
36 |
public static final String TK_ORDNER = "icon-folder"; |
|
37 |
|
|
38 |
/* |
|
39 |
|
|
40 |
Ergaenzt um Garfiken mit Data-URI |
|
41 |
https://wiki.selfhtml.org/wiki/Grafik/Grafiken_mit_Data-URI |
|
42 |
|
|
43 |
src="data:image/gif;base64,R0lGODdhEAAQAMwAAPj7+FmhUYjNfGuxYY |
|
44 |
DJdYTIeanOpT+DOTuANXi/bGOrWj6CONzv2sPjv2CmV1unU4zPgISg6DJnJ3ImTh8Mtbs00aNP1CZSGy0YqLEn47RgXW8amasW |
|
45 |
7XWsmmvX2iuXiwAAAAAEAAQAAAFVyAgjmRpnihqGCkpDQPbGkNUOFk6DZqgHCNGg2T4QAQBoIiRSAwBE4VA4FACKgkB5NGReAS |
|
46 |
FZEmxsQ0whPDi9BiACYQAInXhwOUtgCUQoORFCGt/g4QAIQA7" |
|
47 |
|
|
48 |
Schema |
|
49 |
data:[<mime type>][;charset=<Zeichensatz>][;base64],<Daten> |
|
50 |
|
|
51 |
*/ |
|
52 |
|
|
53 |
private String name; |
|
54 |
//private String pfad; |
|
55 |
private String typ; |
|
56 |
private String typKlasse; |
|
57 |
private boolean bild = false; |
|
58 |
private String miniurl; |
|
59 |
private String imgsrc; |
|
60 |
|
|
61 |
public String getImgSrc() { |
|
62 |
return imgsrc; |
|
63 |
} |
|
64 |
|
|
65 |
public void setImgSrc(String imgSrc) { |
|
66 |
this.imgsrc = imgSrc; |
|
67 |
} |
|
68 |
|
|
69 |
|
|
70 |
public String getMiniurl() { |
|
71 |
return miniurl; |
|
72 |
} |
|
73 |
|
|
74 |
public void setMiniurl(String miniurl) { |
|
75 |
this.miniurl = miniurl; |
|
76 |
} |
|
77 |
|
|
78 |
public String getTypKlasse() { |
|
79 |
return typKlasse; |
|
80 |
} |
|
81 |
|
|
82 |
public void setTypKlasse(String typKlasse) { |
|
83 |
this.typKlasse = typKlasse; |
|
84 |
} |
|
85 |
|
|
86 |
public String getName() { |
|
87 |
return name; |
|
88 |
} |
|
89 |
|
|
90 |
public void setName(String name) { |
|
91 |
this.name = name; |
|
92 |
} |
|
93 |
|
|
94 |
public String getTyp() { |
|
95 |
return typ; |
|
96 |
} |
|
97 |
|
|
98 |
public void setTyp(String typ) { |
|
99 |
this.typ = typ; |
|
100 |
switch(typ) { |
|
101 |
case TYP_DATEI: |
|
102 |
setTypKlasse(TK_DATEI); |
|
103 |
break; |
|
104 |
case TYP_ORDNER: |
|
105 |
setTypKlasse(TK_ORDNER); |
|
106 |
break; |
|
107 |
default: |
|
108 |
setTypKlasse(TK_DATEI); |
|
109 |
break; |
|
110 |
} |
|
111 |
} |
|
112 |
|
|
113 |
public boolean isBild() { |
|
114 |
return bild; |
|
115 |
} |
|
116 |
|
|
117 |
public void setBild(boolean istBild) { |
|
118 |
this.bild = istBild; |
|
119 |
} |
|
120 |
|
|
121 |
//public String getPfad() { |
|
122 |
// return pfad; |
|
123 |
//} |
|
124 |
|
|
125 |
//public void setPfad(String pfad) { |
|
126 |
// this.pfad = pfad; |
|
127 |
//} |
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
} |