Clover icon

Coverage Report

  1. Project Clover database Mon Nov 18 2024 09:38:20 GMT
  2. Package jalview.util

File UserAgent.java

 

Coverage histogram

../../img/srcFileCovDistChart9.png
7% of files have more coverage

Code metrics

4
29
2
1
70
45
4
0.14
14.5
2
2

Classes

Class Line # Actions
UserAgent 25 29 4
0.885714388.6%
 

Contributing tests

This file is covered by 23 tests. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
7    * Jalview is free software: you can redistribute it and/or
8    * modify it under the terms of the GNU General Public License
9    * as published by the Free Software Foundation, either version 3
10    * of the License, or (at your option) any later version.
11    *
12    * Jalview is distributed in the hope that it will be useful, but
13    * WITHOUT ANY WARRANTY; without even the implied warranty
14    * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15    * PURPOSE. See the GNU General Public License for more details.
16    *
17    * You should have received a copy of the GNU General Public License
18    * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19    * The Jalview Authors are detailed in the 'AUTHORS' file.
20    */
21    package jalview.util;
22   
23    import jalview.bin.Cache;
24   
 
25    public class UserAgent
26    {
27   
 
28  48 toggle public static String getUserAgent(String className)
29    {
30  48 StringBuilder sb = new StringBuilder();
31  48 sb.append("Jalview");
32  48 sb.append('/');
33  48 sb.append(Cache.getDefault("VERSION", "Unknown"));
34  48 sb.append(" (");
35  48 sb.append(System.getProperty("os.name"));
36  48 sb.append("; ");
37  48 sb.append(System.getProperty("os.arch"));
38  48 sb.append(' ');
39  48 sb.append(System.getProperty("os.name"));
40  48 sb.append(' ');
41  48 sb.append(System.getProperty("os.version"));
42  48 sb.append("; ");
43  48 sb.append("java/");
44  48 sb.append(System.getProperty("java.version"));
45  48 sb.append("; ");
46  48 sb.append("jalview/");
47  48 sb.append(ChannelProperties.getProperty("channel"));
48  48 if (className != null)
49    {
50  0 sb.append("; ");
51  0 sb.append(className);
52    }
53  48 String installation = Cache.applicationProperties
54    .getProperty("INSTALLATION");
55  48 if (installation != null)
56    {
57  48 sb.append("; ");
58  48 sb.append(installation);
59    }
60  48 sb.append(')');
61  48 sb.append(" help@jalview.org");
62  48 return sb.toString();
63    }
64   
 
65  48 toggle public static String getUserAgent()
66    {
67  48 return getUserAgent(null);
68    }
69   
70    }