Clover icon

Coverage Report

  1. Project Clover database Fri Dec 6 2024 13:47:14 GMT
  2. Package jalview.util

File UserAgent.java

 

Coverage histogram

../../img/srcFileCovDistChart9.png
12% 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 57 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  130 toggle public static String getUserAgent(String className)
29    {
30  130 StringBuilder sb = new StringBuilder();
31  130 sb.append("Jalview");
32  130 sb.append('/');
33  130 sb.append(Cache.getDefault("VERSION", "Unknown"));
34  130 sb.append(" (");
35  130 sb.append(System.getProperty("os.name"));
36  130 sb.append("; ");
37  130 sb.append(System.getProperty("os.arch"));
38  130 sb.append(' ');
39  130 sb.append(System.getProperty("os.name"));
40  130 sb.append(' ');
41  130 sb.append(System.getProperty("os.version"));
42  130 sb.append("; ");
43  130 sb.append("java/");
44  130 sb.append(System.getProperty("java.version"));
45  130 sb.append("; ");
46  130 sb.append("jalview/");
47  130 sb.append(ChannelProperties.getProperty("channel"));
48  130 if (className != null)
49    {
50  0 sb.append("; ");
51  0 sb.append(className);
52    }
53  130 String installation = Cache.applicationProperties
54    .getProperty("INSTALLATION");
55  130 if (installation != null)
56    {
57  130 sb.append("; ");
58  130 sb.append(installation);
59    }
60  130 sb.append(')');
61  130 sb.append(" help@jalview.org");
62  130 return sb.toString();
63    }
64   
 
65  130 toggle public static String getUserAgent()
66    {
67  130 return getUserAgent(null);
68    }
69   
70    }