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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 | package Torello.Java.Build;
import Torello.Java.GSUTIL;
import Torello.Java.OSResponse;
import Torello.Java.Additional.AppendableSafe;
import Torello.Java.Additional.BiAppendable;
import static Torello.Java.C.*;
import java.io.IOException;
import java.io.File;
/**
* This is the last Build-Stage, and it is part of the synchronization of a project with Google
* Cloud Platform Stroage Buckets. This class relies heavily on the GCP Shell-Command
* {@code 'gsutil'} and it's Java implementation - {@link GSUTIL Torello.Java.GSUTIL}.
*
* <BR /><BR />This class' synchronization-efforts involve setting a simple Browser
* {@code 'CACHE-CONTROL'} configuration for all Java-Documentation Files on the relevant Google
* Cloud Server Storage-Bucket. The setting prevents browsers from caching Java-Doc Web-Pages so
* that development efforts where classes and their members are changing frequently won't be cached
* by the browser (and, therefore, won't impede developer-progress)!
*
* <EMBED CLASS=external-html DATA-FILE-ID=STAGE_PRIVATE_NOTE>
* <EMBED CLASS='external-html' DATA-FILE-ID=S08_SET_MAX_AGE>
*/
@Torello.JavaDoc.StaticFunctional
public class S08_SetMaxAge
{
// Completely irrelevant, and the 'private' modifier keeps it off of JavaDoc
private S08_SetMaxAge() { }
public static void set(BuilderRecord brec) throws IOException
{
brec.timers.startStage08();
Printing.startStep(8);
StringBuilder logOnly = new StringBuilder();
final AppendableSafe logAndScreen = new AppendableSafe(
new BiAppendable(System.out, logOnly),
AppendableSafe.USE_APPENDABLE_ERROR
);
// Uses Shell-Contructor:
// (outputAppendable, commandStrAppendable, standardOutput, errorOutput)
// GSUTIL gsutil = new GSUTIL(logOnly, logAndScreen, null, null);
brec.cloudSync.initStage(logOnly, logAndScreen);
OSResponse osr = null;
if (brec.stage8GCSDirs == null)
// osr = gsutil.SMA(brec.cli.GCS_DIR + "**", 120);
osr = brec.cloudSync.setMaxAgeAll();
else
{
logAndScreen.append(BGREEN + "Set Max Age (Browser-Cache):\n\n" + RESET);
for (String gcsDir : brec.stage8GCSDirs) logAndScreen.append('\t' + gcsDir + "\n");
logAndScreen.append('\n');
// osr = gsutil.SMA(brec.stage8GCSDirs, 120);
osr = brec.cloudSync.setMaxAgeSome();
}
Util.HALT_ON_ERROR(osr);
brec.logs.write_S08_LOG(logOnly.toString());
brec.cloudSync.endStage();
brec.timers.endStage08();
}
}
|