我想从建造的jar中排除 AMAuthN.properties.此文件一直显示在已编译jar的根文件夹中.该文件位于AMAuthN\src\main\resources\AMAuthN.properties项目文件夹根目录下.谢谢!
apply plugin: 'java'
apply plugin: 'eclipse'
version = '1.0'
sourceCompatibility = 1.6
targetCompatibility = 1.6
test {
testLogging {
showStandardStreams = true
}
}
// Create a single Jar with all dependencies
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'com.axa.openam'
}
baseName = project.name
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
// Get dependencies from Maven central repository
repositories {
mavenCentral()
}
// …Run Code Online (Sandbox Code Playgroud) 我正在为我的学习目的制作语言应用程序并在Android中练习我希望将所有课程音频存储在一个数组中,当我按下例如音频1时,我为每节课都有一个活动它会弹出与玩家的新活动(AudioPopup) .java)但问题我不想让弹出窗口为每节课播放某些音频我需要的是识别按下了哪个按钮并打开我创建的AudioPopup并播放某些mp3
AudioPopup代码
public class AudioPopup extends AppCompatActivity {
SeekBar seek_bar;
ImageView play_button, pause_button;
MediaPlayer player;
ImageView exitPlayer;
Handler seekHandler = new Handler();
private int [] audioFiles;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.audio_popup);
setFinishOnTouchOutside(false);
audioFiles = new int [] {R.raw.lesson1-1,R.raw.lesson1-2,R.raw.lesson1-3,R.raw.lesson1-4};
getInit();
seekUpdation();
exitPlayer = (ImageView) findViewById(R.id.audio_exit_1);
exitPlayer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
player.stop();
}
});
}
public void getInit() {
seek_bar = (SeekBar) findViewById(R.id.seekbar_1);
play_button = (ImageView) findViewById(R.id.audio_play_1);
pause_button = (ImageView) findViewById(R.id.audio_stop_1);
play_button.setOnClickListener(new View.OnClickListener() …Run Code Online (Sandbox Code Playgroud) 我可以找到更接近这个的问题,但不完全是我想要的。对于许多专家来说,问题可能非常简单:我有一个Hashset包含我自定义的 bean 作为其内容:
Set<TableColumnBean> mySet = new HashSet<TableColumnBean>();
//loop and add values to Hashset
for(String str : tableColumnBeanMap.keySet()){
mySet.add(new TableColumnBean(tableColumnBeanMap.get(str).getTable, `tableColumnBeanMap.get(str).getColumn))`
}
Run Code Online (Sandbox Code Playgroud)
这里 tableColumnBeanMap 是一个 Map,其中包含类型为 bean 的列表TableColumnBean。TableColumnBean是一个简单的 bean,它有两个属性表和列。在循环结束时,我想漂亮地打印 set 的内容,这对于保留作为调试日志选项很有用。我可以考虑使用 java for 循环和打印内容循环遍历集合。但在其他地方,我使用过Jackson图书馆,如:
new ObjectMapper().writeWithDefaultPrettyPrinter().writeValueAsString(myMap)
Run Code Online (Sandbox Code Playgroud)
这在地图上非常有效。我们有类似的东西也适用于 Sets 吗?(像杰克逊漂亮的印刷品这样的衬里会很好 - 因为它产生非常好的读取输出格式并且也不会使您的代码混乱)。
什么是之间的不同DISPOSE_ON_CLOSE和EXIT_ON_CLOSE在setDefaultCloseOperation方法的JFrame类?