Clover icon

Coverage Report

  1. Project Clover database Thu Nov 28 2024 11:45:30 GMT
  2. Package jalview.util

File UserAgent.java

 

Coverage histogram

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