aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/main/java/com/yahoo/net/URI.java
blob: 6e3d48c0b6f1208f06d2d06c979ff9c7460941a8 (plain) (blame)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.net;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

import static com.yahoo.text.Lowercase.toLowerCase;

/**
 * <p>An URI. This is a pure (immutable) value object.</p>
 *
 * <p>This does more normalization of hierarchical URIs (URLs) than
 * described in the RFC and allows hosts with underscores.</p>
 *
 * @author bratseth
 */
public class URI implements Cloneable, Comparable<URI> {

    /** The uri string */
    private String uri;

    /** The scheme of the uri */
    private String scheme = null;

    /** The host part of the uri */
    private String host = null;

    /** The port number of the uri, or -1 if no port is explicitly given */
    private int port = -1;

    /** The part of the uri following the host (host and port) */
    private String rest = null;

    private static final Pattern tokenizePattern = Pattern.compile("[^\\w\\-]");

    private boolean parsedDomain = false;
    private String domain = null;

    private boolean parsedMainTld = false;
    private String mainTld = null;

    private boolean parsedPath = false;
    private String path = null;

    private boolean parsedParams = false;
    private String params = null;

    private boolean parsedFilename = false;
    private String filename = null;

    private boolean parsedExtension = false;
    private String extension = null;

    private boolean parsedQuery = false;
    private String query = null;

    private boolean parsedFragment = false;
    private String fragment = null;


    /** The explanation of why this uri is invalid, or null if it is valid */
    private String invalidExplanation = null;

    /** True if this uri is opaque, false if it is hierarchical */
    private boolean opaque = true;

    /**
     * <p>Creates an URI without keeping the fragment (the part starting by #).
     * If the uri is hierarchical, it is normalized and incorrect hierarchical uris
     * which looks like urls are attempted repaired.</p>
     *
     * <p>Relative uris are not supported.</p>
     *
     * @param uriString the uri string
     * @throws NullPointerException if the given uriString is null
     */
    public URI(String uriString) {
        this(uriString, false);
    }

    /**
     * Creates an URI, optionaly keeping the fragment (the part starting by #).
     * If the uri is hierarchical, it is normalized and incorrect hierarchical uris
     * which looks like urls are attempted repaired.
     *
     * <p>Relative uris are not supported.</p>
     *
     * @param uriString the uri string
     * @param keepFragment true to keep the fragment
     * @throws NullPointerException if the given uriString is null
     */
    public URI(String uriString, boolean keepFragment) {
        this(uriString, keepFragment, false);
    }

    /**
     * Creates an URI, optionaly keeping the fragment (the part starting by #).
     * If the uri is hierarchical, it is normalized and incorrect hierarchical uris
     * which looks like urls are attempted repaired.
     *
     * <p>Relative uris are not supported.</p>
     *
     * @param uriString the uri string
     * @param keepFragment true to keep the fragment
     * @param hierarchicalOnly will force any uri string given to be parsed as
     *        a hierarchical one, causing the uri to be invalid if it isn't
     * @throws NullPointerException if the given uriString is null
     */
    public URI(String uriString, boolean keepFragment, boolean hierarchicalOnly) {
        if (uriString == null) {
            throw new NullPointerException("Can not create an uri from null");
        }

        if (!keepFragment) {
            int fragmentIndex = uriString.indexOf("#");

            if (fragmentIndex >= 0) {
                uriString = uriString.substring(0, fragmentIndex);
            }
        }

        try {
            this.uri = uriString.trim();
            opaque = isOpaque(uri);

            // No further parsing of opaque uris
            if (isOpaque() && !hierarchicalOnly) {
                return;
            }
            opaque = false;
            normalizeHierarchical();
        } catch (IllegalArgumentException e) {
            if (e.getMessage() != null) {
                invalidExplanation = e.getMessage();
            } else {
                Throwable t = e.getCause();
                if (t != null && t.getMessage() != null) {
                    invalidExplanation = t.getMessage();
                } else {
                    invalidExplanation = "Invalid uri: " + e;
                }
            }
        }
    }

    /** Creates an url type uri */
    public URI(String scheme, String host, int port, String rest) {
        this.scheme = scheme;
        this.host = host;
        this.port = port;
        this.rest = rest;
        recombine();
        normalizeHierarchical();
        opaque = false;
    }

    /** Returns whether an url is opaque or hierarchical */
    private boolean isOpaque(String uri) {
        int colonIndex = uri.indexOf(":");

        if (colonIndex < 0) {
            return true;
        } else {
            return !(uri.length() > colonIndex + 1
                    && uri.charAt(colonIndex + 1) == '/');
        }
    }

    /**
     * Returns whether this is a valid URI (after normalizing).
     * All non-hierarchical uri's containing a scheme is valid.
     */
    public boolean isValid() {
        return invalidExplanation == null;
    }

    /**
     * Normalizes this hierarchical uri according to FRC 2396 and the Overture
     * standard. Before normalizing, some simple heuristics are use to make
     * the uri complete if needed. After normalizing, the scheme,
     * host, port and rest of this uri is set if defined.
     *
     * @throws IllegalArgumentException if this uri can not be normalized into a legal uri
     */
    private void normalizeHierarchical() {
        complete();
        escapeNonAscii();
        unescapeHtmlEntities();
        decompose();
        lowCaseHost();
        removeDefaultPortNumber();
        removeTrailingHostDot();
        makeDoubleSlashesSingle();
        recombine();
    }

    /** Applies simple heuristics to complete this uri if needed */
    private void complete() {
        if (uri.startsWith("www.")) {
            uri = "http://" + uri;
        } else if (uri.startsWith("WWW")) {
            uri = "http://" + uri;
        } else if (uri.startsWith("/http:")) {
            uri = uri.substring(1);
        } else if (isFileURIShortHand(uri)) {
            uri = "file://" + uri;
        }
    }

    private boolean isFileURIShortHand(String uri) {
        if (uri.indexOf(":\\") == 1) {
            return true;
        }
        if (uri.indexOf("c:/") == 0) {
            return true;
        }
        if (uri.indexOf("d:/") == 0) {
            return true;
        }
        return false;
    }

    /**
     * Decomposes this uri into scheme, host, port and rest.
     */
    private void decompose() {
        java.net.URI neturi = java.net.URI.create(uri).normalize();

        scheme = neturi.getScheme();

        host = neturi.getHost();
        boolean portAlreadyParsed = false;

        // No host if the host contains underscores
        if (host == null) {
            host = neturi.getAuthority();
            if (host != null) {
                int colonPos = host.lastIndexOf(":");
                if (!scheme.equals("file") && colonPos > -1) {
                    //we probably have an (illegal) URI of type http://under_score.com:5000/
                    try {
                        port = Integer.parseInt(host.substring(colonPos + 1));
                        host = host.substring(0, colonPos);
                        portAlreadyParsed = true;
                    } catch (NumberFormatException nfe) {
                        //empty
                    }
                }
            }
        }

        if ("file".equalsIgnoreCase(scheme)) {
            if (host == null) {
                host = "localhost";
            } else {
                host = repairWindowsDrive(host, uri);
            }
        }
        if (host == null) {
            throw new IllegalArgumentException(
                    "A complete uri must specify a host");
        }
        if (!portAlreadyParsed) {
            port = neturi.getPort();
        }
        rest = (neturi.getRawPath() != null ? neturi.getRawPath() : "")
                + (neturi.getRawQuery() != null
                        ? ("?" + neturi.getRawQuery())
                        : "")
                        + (neturi.getRawFragment() != null
                                ? ("#" + neturi.getRawFragment())
                                : "");
    }

    /** c: turns to c when interpreted by URI. Repair it */
    private String repairWindowsDrive(String host, String uri) {
        if (host.length() != 1) {
            return host;
        }
        int driveIndex = uri.indexOf(host + ":");

        if (driveIndex == 5 || driveIndex == 7) { // file:<drive> or file://<drive>
            return host + ":";
        } else {
            return host;
        }
    }

    /** "http://a/\u00E6" → "http://a/%E6;" */
    private void escapeNonAscii() {
        char[] uriChars = uri.toCharArray();
        StringBuilder result = new StringBuilder(uri.length());

        for (char uriChar : uriChars) {
            if (uriChar >= 0x80 || uriChar == 0x22) {
                result.append("%");
                result.append(Integer.toHexString(uriChar));
                result.append(";");
            } else {
                result.append(uriChar);
            }
        }
        uri = result.toString();
    }

    /** "http://a/&amp;amp;" → "http://a/&amp;" Currently ampersand only */
    private void unescapeHtmlEntities() {
        int ampIndex = uri.indexOf("&amp;");

        if (ampIndex < 0) {
            return;
        }

        StringBuilder result = new StringBuilder(uri.substring(0, ampIndex));

        while (ampIndex >= 0) {
            result.append("&");
            int nextAmpIndex = uri.indexOf("&amp;", ampIndex + 5);

            result.append(
                    uri.substring(ampIndex + 5,
                    nextAmpIndex > 0 ? nextAmpIndex : uri.length()));
            ampIndex = nextAmpIndex;
        }
        uri = result.toString();
    }

    /** "HTTP://a" → "http://a" */
    private void lowCaseHost() {
        host = toLowerCase(host);
    }

    /** "http://a:80" → "http://a" and "https://a:443" → https//a */
    private void removeDefaultPortNumber() {
        if (port == 80 && scheme.equals("http")) {
            port = -1;
        } else if (port == 443 && scheme.equals("https")) {
            port = -1;
        }
    }

    /** "http://a./b" → "http://a/b" */
    private void removeTrailingHostDot() {
        if (host.endsWith(".")) {
            host = host.substring(0, host.length() - 1);
        }
    }

    /** "http://a//b" → "http://a/b" */
    private void makeDoubleSlashesSingle() {
        StringBuilder result = new StringBuilder(rest.length());
        char[] restChars = rest.toCharArray();

        for (int i = 0; i < restChars.length; i++) {
            if (!(i + 1 < restChars.length && restChars[i] == '/'
                    && restChars[i + 1] == '/')) {
                result.append(restChars[i]);
            }
        }
        rest = result.toString();
    }

    /** Recombines the uri from the scheme, host, port and rest */
    private void recombine() {
        StringBuilder recombined = new StringBuilder(100);

        recombined.append(scheme);
        recombined.append("://");
        recombined.append(host);
        if (port > -1) {
            recombined.append(":").append(port);
        }
        if (rest != null) {
            if (!rest.startsWith("/")) {
                recombined.append("/");
            }
            recombined.append(rest);
        } else {
            recombined.append("/"); // RFC 2396 violation, as required by search
        }
        uri = recombined.toString();
    }

    /**
     * Returns the normalized scheme of this URI.
     *
     * @return the normalized scheme (protocol), or null if there is none,
     *         which may only be the case with non-hierarchical URIs
     */
    public String getScheme() {
        return scheme;
    }

    /**
     * Returns whether this URI is hierarchical or opaque.
     * A typical example of an hierarchical URI is an URL,
     * while URI's are mailto, news and such.
     *
     * @return true if the url is opaque, false if it is hierarchical
     */
    public final boolean isOpaque() {
        return opaque;
    }

    /**
     * Returns the normalized host of this URI.
     *
     * @return the normalized host, or null if there is none, which may
     *         only be the case if this is a non-hierarchical uri
     */
    public String getHost() {
        return host;
    }

    /** Returns the port number of this scheme if set explicitly, or -1 otherwise */
    public int getPort() {
        return port;
    }

    /**
     * Returns the <i>rest</i> of this uri, that is what is following the host or port.
     * This is path, query and fragment as defined in RFC 2396. Returns an empty string
     * if this uri has no rest.
     */
    public String getRest() {
        if (rest == null) {
            return null;
        } else if (rest.equals("/")) {
            return "";
        } else {
            return rest;
        }
    }

    public String getDomain() {
        if (parsedDomain) {
            return domain;
        }
        String host = getHost();
        if (host == null) return null;

        int firstDotPos = host.indexOf(".");
        int lastDotPos = host.lastIndexOf(".");

        String domain;
        if (firstDotPos < 0) {
            // "." was not found at all
            domain = host;
        } else if (firstDotPos == lastDotPos) {
            //there is only one "." in the host
            domain = host;
        } else {
            //for www.host.com return host.com
            //TODO: Must be corrected when implementing tldlist
            domain = host.substring(firstDotPos + 1, host.length());
        }

        this.parsedDomain = true;
        this.domain = domain;
        return domain;
    }

    public String getMainTld() {
        if (parsedMainTld) {
            return mainTld;
        }
        String host = getHost();
        if (host == null) return null;

        int lastDotPos = host.lastIndexOf(".");

        String mainTld;
        if (lastDotPos < 0) {
            //no ".", no TLD
            mainTld = null;
        } else if (lastDotPos == host.length() - 1) {
            //the "." is the last character
            mainTld = null;
        } else {
            //for www.yahoo.co.uk return uk
            //TODO: Implement list of TLDs from config?
            mainTld = host.substring(lastDotPos + 1);
        }
        this.parsedMainTld = true;
        this.mainTld = mainTld;
        return mainTld;
    }

    public String getPath() {
        if (parsedPath) {
            return path;
        }
        String rest = this.rest;
        if (rest == null) return null;

        rest = removeFragment(rest);

        int queryPos = rest.lastIndexOf("?");
        if (queryPos > -1) {
            rest = rest.substring(0, queryPos);
        }
        this.parsedPath = true;
        this.path = rest;
        return this.path;
    }

    private String removeFragment(String path) {
        int fragmentPos = path.lastIndexOf("#");
        return (fragmentPos > -1) ? path.substring(0, fragmentPos) : path;
    }

    public String getFilename() {
        if (parsedFilename) {
            return filename;
        }
        String path = getPath();
        if (path == null) return null;

        path = removeParams(path);

        int lastSlash = path.lastIndexOf("/");

        String filename;
        if (lastSlash < 0) {
            //there is no slash, return the path, excluding params
            filename = path;
        } else if (lastSlash == path.length() - 1) {
            //the slash is the last character, there is no filename here
            filename = "";
        } else {
            filename = path.substring(lastSlash + 1);
        }
        this.parsedFilename = true;
        this.filename = filename;
        return filename;
    }

    private String removeParams(String filename) {
        int firstSemicolon = filename.indexOf(";");

        if (firstSemicolon < 0) {
            //there are no params
            return filename;
        }
        return filename.substring(0, firstSemicolon);
    }

    public String getExtension() {
        if (parsedExtension) {
            return extension;
        }
        String filename = getFilename();
        if (filename == null) return null;

        int lastDotPos = filename.lastIndexOf(".");

        String extension;
        if (lastDotPos < 0) {
            //there is no ".", there is no extension
            extension = null;
        } else if (lastDotPos == filename.length() - 1) {
            //the "." is the last character, there is no extension
            extension = null;
        } else {
            extension = filename.substring(lastDotPos + 1);
        }
        this.parsedExtension = true;
        this.extension = extension;
        return extension;
    }

    public String getQuery() {
        if (parsedQuery) {
            return query;
        }
        String rest = this.rest;
        if (rest == null) return null;

        rest = removeFragment(rest);

        int queryPos = rest.lastIndexOf("?");
        String query = null;
        if (queryPos > -1) {
            //we have a query
            query = rest.substring(queryPos+1);
        }
        this.parsedQuery = true;
        this.query = query;
        return query;
    }

    public String getFragment() {
        if (parsedFragment) {
            return fragment;
        }
        String path = this.rest;
        if (path == null) return null;

        int fragmentPos = path.lastIndexOf("#");
        String fragment = null;
        if (fragmentPos > -1) {
            //we have a fragment
            fragment = path.substring(fragmentPos+1);
        }
        this.parsedFragment = true;
        this.fragment = fragment;
        return fragment;
    }

    public String getParams() {
        if (parsedParams) {
            return params;
        }
        String path = getPath();
        if (path == null) return null;

        int semicolonPos = path.indexOf(";");
        String params;
        if (semicolonPos < 0) {
            //there is no semicolon, there are no params here
            params = null;
        } else if (semicolonPos == path.length() - 1) {
            //the semicolon is the last character, there are no params here
            params = null;
        } else {
            params = path.substring(semicolonPos + 1);
        }
        this.parsedParams = true;
        this.params = params;
        return params;
    }

    public static String[] tokenize(String item) {
        return tokenizePattern.split(item);
    }

    public List<Token> tokenize() {
        List<Token> tokens = new ArrayList<>();

        tokens.addAll(tokenize(URLContext.URL_SCHEME, getScheme()));
        tokens.addAll(tokenize(URLContext.URL_HOST, getHost()));
        tokens.addAll(tokenize(URLContext.URL_PORT, getPort() > -1 ? "" + getPort() : null));
        tokens.addAll(tokenize(URLContext.URL_PATH, getPath()));
        tokens.addAll(tokenize(URLContext.URL_QUERY, getQuery()));
        tokens.addAll(tokenize(URLContext.URL_FRAGMENT, getFragment()));

        return tokens;
    }

    private List<Token> tokenize(URLContext context, String item) {
        if (item == null) {
            return new ArrayList<>(0);
        }
        String[] tokenStrings = tokenize(item);
        List<Token> tokens = new ArrayList<>(tokenStrings.length);
        for (String tokenString : tokenStrings) {
            if (tokenString.length() > 0) {
                tokens.add(new Token(context, tokenString));
            }
        }
        return tokens;
    }

    /** Returns an explanation of why this uri is invalid, or null if it is valid */
    public String getInvalidExplanation() {
        return invalidExplanation;
    }

    public int hashCode() {
        return uri.hashCode();
    }

    public boolean equals(Object object) {
        if (!(object instanceof URI)) {
            return false;
        }
        return (toString().equals(object.toString()));
    }

    public int compareTo(URI object) {
        return toString().compareTo(object.toString());
    }

    public Object clone() {
        try {
            return super.clone();
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException("Someone made me unclonable!", e);
        }
    }

    /** Returns a new URI with a changed scheme */
    public URI setScheme(String scheme) {
        return new URI(scheme, host, port, rest);
    }

    /** Returns a new URI with a changed host (or authority) */
    public URI setHost(String host) {
        return new URI(scheme, host, port, rest);
    }

    /** Returns a new URI with a changed port */
    public URI setPort(int port) {
        return new URI(scheme, host, port, rest);
    }

    /** Returns a new URI with a changed rest */
    public URI setRest(String rest) {
        return new URI(scheme, host, port, rest);
    }

    /** Returns a new uri with the an additional parameter */
    public URI addParameter(String name, String value) {
        String newRest = rest;

        if (newRest == null) {
            newRest = "";
        }
        if ( newRest.contains("?")) {
            newRest += "&";
        } else {
            newRest += "?";
        }
        newRest += name + "=" + value;
        return new URI(scheme, host, port, newRest);
    }

    /** Returns this uri as a string */
    public String stringValue() {
        return uri;
    }

    /** Returns this URI as a string */
    public String toString() {
        return uri;
    }

    /**
     * Returns the depth of this uri.
     * The depth of an hierarchical uri equals the number of slashes
     * which are not separating the protocol and the host, and not at the end.
     *
     * @return the depth of this uri if it is hierarchical, or 0 if it is opaque
     */
    public int getDepth() {
        int colonIndex = uri.indexOf(':');

        // count number of slashes in the Uri
        int currentIndex = colonIndex;
        int depth = 0;

        while (currentIndex != -1) {
            currentIndex = uri.indexOf('/', currentIndex);
            if (currentIndex != -1) {
                depth++;
                currentIndex++;
            }
        }

        if (uri.charAt(colonIndex + 1) == '/') {
            depth--;
        }
        if (uri.charAt(colonIndex + 2) == '/') {
            depth--;
        }
        if ((uri.charAt(uri.length() - 1) == '/')
                && ((uri.length() - 1) > (colonIndex + 2))) {
            depth--;
        }
        return depth;
    }


    public static class Token {
        private final URLContext context;
        private final String token;

        private Token(URLContext context, String token) {
            this.context = context;
            this.token = token;
        }

        public URLContext getContext() {
            return context;
        }

        public String getToken() {
            return token;
        }
    }

    public enum URLContext {
        URL_SCHEME(0, "scheme"),
        URL_HOST(1, "host"),
        URL_DOMAIN(2, "domain"),
        URL_MAINTLD(3, "maintld"),
        URL_PORT(4, "port"),
        URL_PATH(5, "path"),
        URL_FILENAME(6, "filename"),
        URL_EXTENSION(7, "extension"),
        URL_PARAMS(8, "params"),
        URL_QUERY(9, "query"),
        URL_FRAGMENT(10, "fragment");

        public final int id;
        public final String name;

        URLContext(int id, String name) {
            this.id = id;
            this.name = name;
        }
    }

}